Changeset 21354 for trunk/src/crypt32/oid.c
- Timestamp:
- Feb 21, 2010, 5:32:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crypt32/oid.c
r21311 r21354 23 23 #include <stdio.h> 24 24 #include <stdarg.h> 25 #include <string.h> 25 26 #define NONAMELESSUNION 26 27 #include "windef.h" … … 61 62 0, 0, &funcSetCS, 62 63 { &funcSetCSDebug.ProcessLocksList, &funcSetCSDebug.ProcessLocksList }, 63 0, 0, { (DWORD _PTR)(__FILE__ ": funcSetCS") }64 0, 0, { (DWORD)(DWORD_PTR)(__FILE__ ": funcSetCS") } 64 65 }; 65 66 static RTL_CRITICAL_SECTION funcSetCS = { &funcSetCSDebug, -1, 0, 0, 0, 0 }; … … 106 107 } 107 108 setCursor->cs.DebugInfo->Spare[0] = 0; 108 DeleteCriticalSection( &setCursor->cs);109 DeleteCriticalSection((CRITICAL_SECTION*)&setCursor->cs); 109 110 CryptMemFree(setCursor); 110 111 } … … 121 122 TRACE("(%s, %x)\n", debugstr_a(pszFuncName), dwFlags); 122 123 123 EnterCriticalSection( &funcSetCS);124 EnterCriticalSection((CRITICAL_SECTION*)&funcSetCS); 124 125 LIST_FOR_EACH_ENTRY(cursor, &funcSets, struct OIDFunctionSet, next) 125 126 { … … 139 140 if (ret->name) 140 141 { 141 InitializeCriticalSection( &ret->cs);142 ret->cs.DebugInfo->Spare[0] = (DWORD _PTR)(__FILE__ ": OIDFunctionSet.cs");142 InitializeCriticalSection((CRITICAL_SECTION*)&ret->cs); 143 ret->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": OIDFunctionSet.cs"); 143 144 list_init(&ret->functions); 144 145 strcpy(ret->name, pszFuncName); … … 152 153 } 153 154 } 154 LeaveCriticalSection( &funcSetCS);155 LeaveCriticalSection((CRITICAL_SECTION*)&funcSetCS); 155 156 156 157 return (HCRYPTOIDFUNCSET)ret; … … 252 253 DWORD i; 253 254 254 EnterCriticalSection( &set->cs);255 EnterCriticalSection((CRITICAL_SECTION*)&set->cs); 255 256 for (i = 0; ret && i < cFuncEntry; i++) 256 257 { … … 281 282 ret = FALSE; 282 283 } 283 LeaveCriticalSection( &set->cs);284 LeaveCriticalSection((CRITICAL_SECTION*)&set->cs); 284 285 } 285 286 else … … 339 340 if (lib) 340 341 { 341 *ppvFuncAddr = GetProcAddress(lib, funcName);342 *ppvFuncAddr = (LPVOID)GetProcAddress(lib, funcName); 342 343 if (*ppvFuncAddr) 343 344 { … … 399 400 struct OIDFunction *function; 400 401 401 EnterCriticalSection( &set->cs);402 EnterCriticalSection((CRITICAL_SECTION*)&set->cs); 402 403 LIST_FOR_EACH_ENTRY(function, &set->functions, struct OIDFunction, next) 403 404 { … … 424 425 } 425 426 } 426 LeaveCriticalSection( &set->cs);427 LeaveCriticalSection((CRITICAL_SECTION*)&set->cs); 427 428 } 428 429 if (!*ppvFuncAddr) … … 461 462 if (*lib) 462 463 { 463 *ppvFuncAddr = GetProcAddress(*lib, func);464 *ppvFuncAddr = (LPVOID)GetProcAddress(*lib, func); 464 465 if (*ppvFuncAddr) 465 466 ret = TRUE; … … 648 649 { 649 650 r = RegSetValueExA(hKey, "FuncName", 0, REG_SZ, 650 ( const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1);651 (LPBYTE)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1); 651 652 if (r != ERROR_SUCCESS) goto error_close_key; 652 653 } 653 r = RegSetValueExW(hKey, DllW, 0, REG_SZ, ( const BYTE*) pwszDll,654 r = RegSetValueExW(hKey, DllW, 0, REG_SZ, (LPBYTE) pwszDll, 654 655 (lstrlenW(pwszDll) + 1) * sizeof (WCHAR)); 655 656 … … 758 759 else 759 760 { 760 rc = RegSetValueExW(hKey, pwszValueName, 0, dwValueType, pbValueData,761 rc = RegSetValueExW(hKey, pwszValueName, 0, dwValueType, (LPBYTE)pbValueData, 761 762 cbValueData); 762 763 if (rc) … … 928 929 LONG r; 929 930 930 if ((r = RegSetValueExW(key, DllW, 0, REG_MULTI_SZ, ( const BYTE *)dlls,931 len * sizeof (WCHAR))) )931 if ((r = RegSetValueExW(key, DllW, 0, REG_MULTI_SZ, (LPBYTE)dlls, 932 len * sizeof (WCHAR))) != 0) 932 933 SetLastError(r); 933 934 return r == ERROR_SUCCESS; … … 990 991 991 992 dlls = CRYPT_GetDefaultOIDDlls(key); 992 if ((ret = CRYPT_RemoveStringFromMultiString(dlls, pwszDll)) )993 if ((ret = CRYPT_RemoveStringFromMultiString(dlls, pwszDll)) != FALSE) 993 994 ret = CRYPT_SetDefaultOIDDlls(key, dlls); 994 995 CryptMemFree(dlls); … … 1031 1032 0, 0, &oidInfoCS, 1032 1033 { &oidInfoCSDebug.ProcessLocksList, &oidInfoCSDebug.ProcessLocksList }, 1033 0, 0, { (DWORD _PTR)(__FILE__ ": oidInfoCS") }1034 0, 0, { (DWORD)(DWORD_PTR)(__FILE__ ": oidInfoCS") } 1034 1035 }; 1035 1036 static RTL_CRITICAL_SECTION oidInfoCS = { &oidInfoCSDebug, -1, 0, 0, 0, 0 }; … … 1409 1410 LPCWSTR stringresource = NULL; 1410 1411 int len = LoadStringW(hInstance, 1411 (UINT _PTR)oidInfoConstructors[i].pwszName,1412 (UINT)(UINT_PTR)oidInfoConstructors[i].pwszName, 1412 1413 (LPWSTR)&stringresource, 0); 1413 1414 … … 1426 1427 info->info.dwGroupId = oidInfoConstructors[i].dwGroupId; 1427 1428 info->info.u.Algid = oidInfoConstructors[i].Algid; 1428 if (stringresource && (char*)stringresource != 0xAAAAAAAA)1429 if (stringresource && (char*)stringresource != (char*)0xAAAAAAAA) 1429 1430 memcpy(info + 1, stringresource, len*sizeof(WCHAR)); 1430 1431 ((LPWSTR)(info + 1))[len] = 0; … … 1450 1451 LIST_FOR_EACH_ENTRY_SAFE(info, next, &oidInfo, struct OIDInfo, entry) 1451 1452 { 1452 if (info > 0x10000)1453 { 1454 if (&info->entry >0x10000)1453 if (info > (struct OIDInfo*)0x10000) 1454 { 1455 if (&info->entry > (struct list*)0x10000) 1455 1456 list_remove(&info->entry); 1456 1457 CryptMemFree(info); … … 1471 1472 pfnEnumOIDInfo); 1472 1473 1473 EnterCriticalSection( &oidInfoCS);1474 EnterCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1474 1475 LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) 1475 1476 { … … 1481 1482 } 1482 1483 } 1483 LeaveCriticalSection( &oidInfoCS);1484 LeaveCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1484 1485 return ret; 1485 1486 } … … 1499 1500 1500 1501 TRACE("CRYPT_OID_INFO_ALGID_KEY: %d\n", *(DWORD *)pvKey); 1501 EnterCriticalSection( &oidInfoCS);1502 EnterCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1502 1503 LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) 1503 1504 { … … 1509 1510 } 1510 1511 } 1511 LeaveCriticalSection( &oidInfoCS);1512 LeaveCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1512 1513 break; 1513 1514 } … … 1517 1518 1518 1519 TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w((LPWSTR)pvKey)); 1519 EnterCriticalSection( &oidInfoCS);1520 EnterCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1520 1521 LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) 1521 1522 { … … 1527 1528 } 1528 1529 } 1529 LeaveCriticalSection( &oidInfoCS);1530 LeaveCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1530 1531 break; 1531 1532 } … … 1536 1537 1537 1538 TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid)); 1538 EnterCriticalSection( &oidInfoCS);1539 EnterCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1539 1540 LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) 1540 1541 { … … 1546 1547 } 1547 1548 } 1548 LeaveCriticalSection( &oidInfoCS);1549 LeaveCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1549 1550 break; 1550 1551 } … … 1554 1555 1555 1556 TRACE("CRYPT_OID_INFO_SIGN_KEY: %d\n", *(DWORD *)pvKey); 1556 EnterCriticalSection( &oidInfoCS);1557 EnterCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1557 1558 LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) 1558 1559 { … … 1567 1568 } 1568 1569 } 1569 LeaveCriticalSection( &oidInfoCS);1570 LeaveCriticalSection((CRITICAL_SECTION*)&oidInfoCS); 1570 1571 break; 1571 1572 }
Note:
See TracChangeset
for help on using the changeset viewer.