- Timestamp:
- Feb 21, 2010, 5:32:09 PM (16 years ago)
- Location:
- trunk/src/crypt32
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crypt32/base64.c
r21311 r21354 379 379 if (!ret) 380 380 outLen += len; 381 if ( cchString - (nextBlock - pszString) <= 0)381 if ((LONG)cchString - (nextBlock - pszString) <= 0) 382 382 nextBlock = NULL; 383 383 } -
trunk/src/crypt32/cert.c
r21311 r21354 20 20 #include <assert.h> 21 21 #include <stdarg.h> 22 #include <string.h> 22 23 23 24 #define NONAMELESSUNION … … 124 125 125 126 CryptMemFree(certContext->pbCertEncoded); 126 LocalFree( certContext->pCertInfo);127 LocalFree((HANDLE)certContext->pCertInfo); 127 128 } 128 129 … … 892 893 893 894 len = rsaPubKey->bitlen; 894 LocalFree( buf);895 LocalFree((HANDLE)buf); 895 896 } 896 897 } … … 1046 1047 1047 1048 if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER, 1048 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) )1049 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) != NULL) 1049 1050 { 1050 1051 CERT_AUTHORITY_KEY_ID_INFO *info; … … 1077 1078 else 1078 1079 ret = FALSE; 1079 LocalFree( info);1080 LocalFree((HANDLE)info); 1080 1081 } 1081 1082 } 1082 1083 else if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER2, 1083 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) )1084 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) != NULL) 1084 1085 { 1085 1086 CERT_AUTHORITY_KEY_ID2_INFO *info; … … 1131 1132 else 1132 1133 ret = FALSE; 1133 LocalFree( info);1134 LocalFree((HANDLE)info); 1134 1135 } 1135 1136 } … … 1566 1567 CryptDestroyHash(hHash); 1567 1568 } 1568 LocalFree( buf);1569 LocalFree((HANDLE)buf); 1569 1570 } 1570 1571 } … … 1612 1613 } 1613 1614 } 1614 LocalFree( info);1615 LocalFree((HANDLE)info); 1615 1616 } 1616 1617 return ret; … … 1878 1879 ret = FALSE; 1879 1880 } 1880 LocalFree( signedCert);1881 LocalFree((HANDLE)signedCert); 1881 1882 } 1882 1883 } … … 1984 1985 } 1985 1986 if (usage) 1986 LocalFree( usage);1987 LocalFree((HANDLE)usage); 1987 1988 TRACE("returning %d\n", ret); 1988 1989 return ret; … … 2006 2007 ret = CertSetCertificateContextProperty(pCertContext, 2007 2008 CERT_ENHKEY_USAGE_PROP_ID, 0, &blob); 2008 LocalFree( blob.pbData);2009 LocalFree((HANDLE)blob.pbData); 2009 2010 } 2010 2011 } … … 2461 2462 context = CertCreateCertificateContext(X509_ASN_ENCODING, 2462 2463 encodedSignedCert, encodedSignedCertSize); 2463 LocalFree( encodedSignedCert);2464 LocalFree((HANDLE)encodedSignedCert); 2464 2465 } 2465 2466 } … … 2697 2698 if (context && !(dwFlags & CERT_CREATE_SELFSIGN_NO_KEY_INFO)) 2698 2699 CertContext_SetKeyProvInfo(context, pKeyProvInfo, hProv); 2699 LocalFree( blob.pbData);2700 LocalFree((HANDLE)blob.pbData); 2700 2701 } 2701 2702 } -
trunk/src/crypt32/chain.c
r21311 r21354 18 18 */ 19 19 #include <stdarg.h> 20 #include <string.h> 20 21 #define NONAMELESSUNION 21 22 #include "windef.h" … … 361 362 CERT_TRUST_IS_NOT_SIGNATURE_VALID; 362 363 } 363 CRYPT_CheckTrustedStatus( hRoot, rootElement);364 CRYPT_CheckTrustedStatus((HCERTSTORE)hRoot, rootElement); 364 365 } 365 366 … … 391 392 constraints->fCA = 392 393 info->SubjectType.pbData[0] & CERT_CA_SUBJECT_FLAG; 393 LocalFree( info);394 LocalFree((HANDLE)info); 394 395 } 395 396 } … … 430 431 431 432 if ((validBasicConstraints = CRYPT_DecodeBasicConstraints(cert, 432 &constraints, TRUE)) )433 &constraints, TRUE)) != NULL) 433 434 { 434 435 if (!constraints.fCA) … … 499 500 else if (!name) 500 501 ; /* no match */ 501 else if ((at = strchrW(constraint, '@')) )502 else if ((at = strchrW(constraint, '@')) != NULL) 502 503 match = !lstrcmpiW(constraint, name); 503 504 else 504 505 { 505 if ((at = strchrW(name, '@')) )506 if ((at = strchrW(name, '@')) != NULL) 506 507 match = url_matches(constraint, at + 1, trustErrorStatus); 507 508 else … … 609 610 610 611 if ((ext = CertFindExtension(szOID_SUBJECT_ALT_NAME, cert->cExtension, 611 cert->rgExtension)) )612 cert->rgExtension)) != NULL) 612 613 { 613 614 CERT_ALT_NAME_INFO *subjectName; … … 631 632 trustErrorStatus, 632 633 0, CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT); 633 LocalFree( subjectName);634 LocalFree((HANDLE)subjectName); 634 635 } 635 636 } … … 654 655 655 656 if ((ext = CertFindExtension(szOID_NAME_CONSTRAINTS, cert->cExtension, 656 cert->rgExtension)) )657 cert->rgExtension)) != NULL) 657 658 { 658 659 DWORD size; … … 687 688 688 689 if ((nameConstraints = CRYPT_GetNameConstraints( 689 chain->rgpElement[i]->pCertContext->pCertInfo)) )690 chain->rgpElement[i]->pCertContext->pCertInfo)) != NULL) 690 691 { 691 692 for (j = i - 1; j >= 0; j--) … … 706 707 } 707 708 } 708 LocalFree( nameConstraints);709 LocalFree((HANDLE)nameConstraints); 709 710 } 710 711 } … … 772 773 rootElement->TrustStatus.dwInfoStatus |= 773 774 CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER; 774 CRYPT_CheckRootCert( engine->hRoot, rootElement);775 CRYPT_CheckRootCert((HCERTCHAINENGINE)engine->hRoot, rootElement); 775 776 } 776 777 CRYPT_CombineTrustStatus(&chain->TrustStatus, &rootElement->TrustStatus); … … 786 787 *infoStatus = 0; 787 788 if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER, 788 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) )789 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) != NULL) 789 790 { 790 791 CERT_AUTHORITY_KEY_ID_INFO *info; … … 822 823 *infoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER; 823 824 } 824 LocalFree( info);825 LocalFree((HANDLE)info); 825 826 } 826 827 } 827 828 else if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER2, 828 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) )829 subject->pCertInfo->cExtension, subject->pCertInfo->rgExtension)) != NULL) 829 830 { 830 831 CERT_AUTHORITY_KEY_ID2_INFO *info; … … 878 879 *infoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER; 879 880 } 880 LocalFree( info);881 LocalFree((HANDLE)info); 881 882 } 882 883 } … … 975 976 */ 976 977 if ((ret = CRYPT_GetSimpleChainForCert(engine, world, cert, pTime, 977 &simpleChain)) )978 &simpleChain)) != NULL) 978 979 { 979 980 PCertificateChain chain = CryptMemAlloc(sizeof(CertificateChain)); -
trunk/src/crypt32/collectionstore.c
r21311 r21354 17 17 */ 18 18 #include <stdarg.h> 19 #include <string.h> 19 20 #include "windef.h" 20 21 #include "winbase.h" … … 60 61 } 61 62 cs->cs.DebugInfo->Spare[0] = 0; 62 DeleteCriticalSection( &cs->cs);63 DeleteCriticalSection((CRITICAL_SECTION*)&cs->cs); 63 64 CRYPT_FreeStore((PWINECRYPT_CERTSTORE)store); 64 65 } … … 106 107 PWINE_STORE_LIST_ENTRY entry, next; 107 108 108 EnterCriticalSection( &store->cs);109 EnterCriticalSection((CRITICAL_SECTION*)&store->cs); 109 110 LIST_FOR_EACH_ENTRY_SAFE(entry, next, &store->stores, 110 111 WINE_STORE_LIST_ENTRY, entry) … … 121 122 } 122 123 } 123 LeaveCriticalSection( &store->cs);124 LeaveCriticalSection((CRITICAL_SECTION*)&store->cs); 124 125 if (!storeEntry) 125 126 SetLastError(E_ACCESSDENIED); … … 221 222 TRACE("(%p, %p)\n", store, pPrev); 222 223 223 EnterCriticalSection( &cs->cs);224 EnterCriticalSection((CRITICAL_SECTION*)&cs->cs); 224 225 if (pPrev) 225 226 { … … 249 250 } 250 251 } 251 LeaveCriticalSection( &cs->cs);252 LeaveCriticalSection((CRITICAL_SECTION*)&cs->cs); 252 253 if (ret) 253 254 ((PCERT_CONTEXT)ret)->hCertStore = store; … … 300 301 TRACE("(%p, %p)\n", store, pPrev); 301 302 302 EnterCriticalSection( &cs->cs);303 EnterCriticalSection((CRITICAL_SECTION*)&cs->cs); 303 304 if (pPrev) 304 305 { … … 327 328 } 328 329 } 329 LeaveCriticalSection( &cs->cs);330 LeaveCriticalSection((CRITICAL_SECTION*)&cs->cs); 330 331 if (ret) 331 332 ((PCRL_CONTEXT)ret)->hCertStore = store; … … 378 379 TRACE("(%p, %p)\n", store, pPrev); 379 380 380 EnterCriticalSection( &cs->cs);381 EnterCriticalSection((CRITICAL_SECTION*)&cs->cs); 381 382 if (pPrev) 382 383 { … … 405 406 } 406 407 } 407 LeaveCriticalSection( &cs->cs);408 LeaveCriticalSection((CRITICAL_SECTION*)&cs->cs); 408 409 if (ret) 409 410 ((PCTL_CONTEXT)ret)->hCertStore = store; … … 451 452 store->hdr.ctls.enumContext = CRYPT_CollectionEnumCTL; 452 453 store->hdr.ctls.deleteContext = CRYPT_CollectionDeleteCTL; 453 InitializeCriticalSection( &store->cs);454 store->cs.DebugInfo->Spare[0] = (DWORD _PTR)(__FILE__ ": PWINE_COLLECTIONSTORE->cs");454 InitializeCriticalSection((CRITICAL_SECTION*)&store->cs); 455 store->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PWINE_COLLECTIONSTORE->cs"); 455 456 list_init(&store->stores); 456 457 } … … 498 499 list_init(&entry->entry); 499 500 TRACE("%p: adding %p, priority %d\n", collection, entry, dwPriority); 500 EnterCriticalSection( &collection->cs);501 EnterCriticalSection((CRITICAL_SECTION*)&collection->cs); 501 502 if (dwPriority) 502 503 { … … 519 520 else 520 521 list_add_tail(&collection->stores, &entry->entry); 521 LeaveCriticalSection( &collection->cs);522 LeaveCriticalSection((CRITICAL_SECTION*)&collection->cs); 522 523 ret = TRUE; 523 524 } … … 550 551 return; 551 552 } 552 EnterCriticalSection( &collection->cs);553 EnterCriticalSection((CRITICAL_SECTION*)&collection->cs); 553 554 LIST_FOR_EACH_ENTRY_SAFE(store, next, &collection->stores, 554 555 WINE_STORE_LIST_ENTRY, entry) … … 562 563 } 563 564 } 564 LeaveCriticalSection( &collection->cs);565 } 565 LeaveCriticalSection((CRITICAL_SECTION*)&collection->cs); 566 } -
trunk/src/crypt32/context.c
r21311 r21354 18 18 #include <assert.h> 19 19 #include <stdarg.h> 20 #include <string.h> 20 21 #include "windef.h" 21 22 #include "winbase.h" … … 196 197 list->contextInterface = contextInterface; 197 198 list->contextSize = contextSize; 198 InitializeCriticalSection( &list->cs);199 list->cs.DebugInfo->Spare[0] = (DWORD _PTR)(__FILE__ ": ContextList.cs");199 InitializeCriticalSection((CRITICAL_SECTION*)&list->cs); 200 list->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": ContextList.cs"); 200 201 list_init(&list->contexts); 201 202 } … … 234 235 235 236 TRACE("adding %p\n", context); 236 EnterCriticalSection( &list->cs);237 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 237 238 if (toReplace) 238 239 { … … 248 249 else 249 250 list_add_head(&list->contexts, entry); 250 LeaveCriticalSection( &list->cs);251 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 251 252 } 252 253 return context; … … 258 259 void *ret; 259 260 260 EnterCriticalSection( &list->cs);261 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 261 262 if (pPrev) 262 263 { … … 268 269 else 269 270 listNext = list_next(&list->contexts, &list->contexts); 270 LeaveCriticalSection( &list->cs);271 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 271 272 272 273 if (listNext) … … 284 285 struct list *entry = ContextList_ContextToEntry(list, context); 285 286 286 EnterCriticalSection( &list->cs);287 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 287 288 list_remove(entry); 288 LeaveCriticalSection( &list->cs);289 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 289 290 list->contextInterface->confree(context); 290 291 } … … 294 295 struct list *entry, *next; 295 296 296 EnterCriticalSection( &list->cs);297 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 297 298 LIST_FOR_EACH_SAFE(entry, next, &list->contexts) 298 299 { … … 303 304 list->contextInterface->confree(context); 304 305 } 305 LeaveCriticalSection( &list->cs);306 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 306 307 } 307 308 … … 310 311 ContextList_Empty(list); 311 312 list->cs.DebugInfo->Spare[0] = 0; 312 DeleteCriticalSection( &list->cs);313 DeleteCriticalSection((CRITICAL_SECTION*)&list->cs); 313 314 CryptMemFree(list); 314 315 } -
trunk/src/crypt32/crl.c
r21311 r21354 20 20 #include <assert.h> 21 21 #include <stdarg.h> 22 #include <string.h> 22 23 #include "windef.h" 23 24 #include "winbase.h" … … 239 240 240 241 CryptMemFree(crlContext->pbCrlEncoded); 241 LocalFree( crlContext->pCrlInfo);242 LocalFree((HANDLE)crlContext->pCrlInfo); 242 243 } 243 244 -
trunk/src/crypt32/crypt32_private.h
r21325 r21354 397 397 #define strcasecmp lstrcmpiA 398 398 399 /** 400 * In crypt32\main.c but not prototyped elsewhere 401 */ 402 403 int vsnprintf (char *buf, int n, const char *fmt, va_list args); 404 int snprintf (char *buf, int n, const char *fmt, ...); 405 399 406 #endif -
trunk/src/crypt32/ctl.c
r21311 r21354 20 20 #include <assert.h> 21 21 #include <stdarg.h> 22 #include <string.h> 22 23 23 24 #define NONAMELESSUNION … … 426 427 CryptMemFree(ctl); 427 428 ctl = NULL; 428 LocalFree( ctlInfo);429 LocalFree((HANDLE)ctlInfo); 429 430 CryptMemFree(content); 430 431 CryptMsgClose(msg); … … 447 448 CryptMemFree(ctlContext->pbCtlEncoded); 448 449 CryptMemFree(ctlContext->pbCtlContext); 449 LocalFree( ctlContext->pCtlInfo);450 LocalFree((HANDLE)ctlContext->pCtlInfo); 450 451 } 451 452 -
trunk/src/crypt32/decode.c
r21311 r21354 38 38 #include <stdio.h> 39 39 #include <stdlib.h> 40 #include <string.h> 41 #include <ctype.h> 40 42 41 43 #define NONAMELESSUNION … … 46 48 #include "winnls.h" 47 49 #include "snmp.h" 48 #include "wine /debug.h"49 #include "wine /exception.h"50 #include "wine\debug.h" 51 #include "wine\exception.h" 50 52 #include "crypt32_private.h" 51 53 … … 224 226 *(BYTE **)pvStructInfo = pDecodePara->pfnAlloc(bytesNeeded); 225 227 else 226 *(BYTE **)pvStructInfo = LocalAlloc(0, bytesNeeded);228 *(BYTE **)pvStructInfo = (BYTE*)LocalAlloc(0, bytesNeeded); 227 229 if (!*(BYTE **)pvStructInfo) 228 230 ret = FALSE; … … 246 248 pDecodePara->pfnFree(pv); 247 249 else 248 LocalFree( pv);250 LocalFree((HANDLE)pv); 249 251 } 250 252 … … 329 331 330 332 if ((ret = CRYPT_GetLengthIndefinite(ptr, 331 cbEncoded - (ptr - pbEncoded), &itemLen)) )333 cbEncoded - (ptr - pbEncoded), &itemLen)) != FALSE) 332 334 { 333 335 BYTE itemLenBytes = GET_LEN_BYTES(ptr[1]); … … 484 486 DWORD dataLen; 485 487 486 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) )488 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE) 487 489 { 488 490 DWORD lenBytes = GET_LEN_BYTES(pbEncoded[1]), cbDecoded; … … 547 549 *pcbStructInfo = bytesNeeded; 548 550 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, 549 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) )551 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 550 552 { 551 553 BYTE *nextData; … … 623 625 DWORD dataLen; 624 626 625 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) )627 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE) 626 628 { 627 629 DWORD bytesNeeded, cItems = 0, decoded; … … 664 666 */ 665 667 if ((ret = CRYPT_GetLengthIndefinite(ptr, 666 cbEncoded - (ptr - pbEncoded), &itemDataLen)) )668 cbEncoded - (ptr - pbEncoded), &itemDataLen)) != FALSE) 667 669 { 668 670 if (itemDataLen == CMSG_INDEFINITE_LENGTH) … … 712 714 *pcbStructInfo = bytesNeeded; 713 715 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, 714 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) )716 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 715 717 { 716 718 DWORD i; … … 778 780 DWORD dataLen; 779 781 780 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )782 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 781 783 { 782 784 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 790 792 if (!pvStructInfo) 791 793 *pcbStructInfo = bytesNeeded; 792 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, bytesNeeded)) )794 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, bytesNeeded)) != FALSE) 793 795 { 794 796 CRYPT_DER_BLOB *blob; … … 902 904 DWORD dataLen; 903 905 904 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )906 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 905 907 { 906 908 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 939 941 DWORD dataLen; 940 942 941 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )943 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 942 944 { 943 945 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 1046 1048 signedCert->ToBeSigned.cbData, dwFlags, pDecodePara, 1047 1049 pvStructInfo, pcbStructInfo); 1048 LocalFree( signedCert);1050 LocalFree((HANDLE)signedCert); 1049 1051 } 1050 1052 } … … 1186 1188 signedCrl->ToBeSigned.cbData, dwFlags, pDecodePara, 1187 1189 pvStructInfo, pcbStructInfo); 1188 LocalFree( signedCrl);1190 LocalFree((HANDLE)signedCrl); 1189 1191 } 1190 1192 } … … 1217 1219 pvStructInfo, *pcbStructInfo); 1218 1220 1219 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )1221 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 1220 1222 { 1221 1223 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 1434 1436 CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo; 1435 1437 1436 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )1438 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 1437 1439 { 1438 1440 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 1621 1623 CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo; 1622 1624 1623 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )1625 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 1624 1626 { 1625 1627 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 1952 1954 done = TRUE; 1953 1955 else if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, 1954 &dataLen)) )1956 &dataLen)) != FALSE) 1955 1957 { 1956 1958 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 2004 2006 pvStructInfo, *pcbStructInfo); 2005 2007 2006 if ((ret = CRYPT_FindEncodedLen(pbEncoded, cbEncoded, &encodedLen)) )2008 if ((ret = CRYPT_FindEncodedLen(pbEncoded, cbEncoded, &encodedLen)) != FALSE) 2007 2009 { 2008 2010 if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) … … 2229 2231 else if ((ret = CRYPT_AsnDecodeSMIMECapabilitiesInternal(pbEncoded, 2230 2232 cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, 2231 NULL)) )2233 NULL)) != FALSE) 2232 2234 { 2233 2235 if (!pvStructInfo) 2234 2236 *pcbStructInfo = bytesNeeded; 2235 2237 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 2236 pvStructInfo, pcbStructInfo, bytesNeeded)) )2238 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 2237 2239 { 2238 2240 PCRYPT_SMIME_CAPABILITIES capabilities; … … 2267 2269 LPSTR *pStr = pvStructInfo; 2268 2270 2269 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )2271 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 2270 2272 { 2271 2273 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 2400 2402 DWORD dataLen; 2401 2403 2402 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )2404 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 2403 2405 { 2404 2406 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 2569 2571 *pcbStructInfo = bytesNeeded; 2570 2572 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 2571 pvStructInfo, pcbStructInfo, bytesNeeded)) )2573 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 2572 2574 { 2573 2575 PCERT_POLICY_QUALIFIER_USER_NOTICE notice; … … 2640 2642 *pcbStructInfo = bytesNeeded; 2641 2643 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 2642 pvStructInfo, pcbStructInfo, bytesNeeded)) )2644 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 2643 2645 { 2644 2646 PCRYPT_ATTRIBUTE attr; … … 2699 2701 else if ((ret = CRYPT_AsnDecodePKCSAttributesInternal(pbEncoded, 2700 2702 cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, 2701 NULL)) )2703 NULL)) != FALSE) 2702 2704 { 2703 2705 if (!pvStructInfo) 2704 2706 *pcbStructInfo = bytesNeeded; 2705 2707 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 2706 pvStructInfo, pcbStructInfo, bytesNeeded)) )2708 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 2707 2709 { 2708 2710 PCRYPT_ATTRIBUTES attrs; … … 2790 2792 2791 2793 if ((ret = CRYPT_AsnDecodePubKeyInfoInternal(pbEncoded, cbEncoded, 2792 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) )2794 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE) 2793 2795 { 2794 2796 if (!pvStructInfo) 2795 2797 *pcbStructInfo = bytesNeeded; 2796 2798 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 2797 pvStructInfo, pcbStructInfo, bytesNeeded)) )2799 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 2798 2800 { 2799 2801 PCERT_PUBLIC_KEY_INFO info; … … 2883 2885 return FALSE; 2884 2886 } 2885 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )2887 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 2886 2888 { 2887 2889 switch (pbEncoded[0] & ASN_TYPE_MASK) … … 3168 3170 * Check the outer length is valid: 3169 3171 */ 3170 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) )3172 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE) 3171 3173 { 3172 3174 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 3178 3180 cbEncoded -= 2; /* space for 0 TLV */ 3179 3181 /* Check the inner length is valid: */ 3180 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &innerLen)) )3182 if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &innerLen)) != FALSE) 3181 3183 { 3182 3184 DWORD decodedLen; … … 3314 3316 3315 3317 if ((ret = CRYPT_AsnDecodeAltNameInternal(pbEncoded, cbEncoded, 3316 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) )3318 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE) 3317 3319 { 3318 3320 if (!pvStructInfo) 3319 3321 *pcbStructInfo = bytesNeeded; 3320 3322 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 3321 pvStructInfo, pcbStructInfo, bytesNeeded)) )3323 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 3322 3324 { 3323 3325 CERT_ALT_NAME_INFO *name; … … 3607 3609 } 3608 3610 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 3609 pvStructInfo, pcbStructInfo, bytesNeeded)) )3611 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 3610 3612 { 3611 3613 BLOBHEADER *hdr; … … 3628 3630 decodedKey->modulus.cbData); 3629 3631 } 3630 LocalFree( decodedKey);3632 LocalFree((HANDLE)decodedKey); 3631 3633 } 3632 3634 } … … 3650 3652 pvStructInfo, *pcbStructInfo, pcbDecoded); 3651 3653 3652 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )3654 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 3653 3655 { 3654 3656 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 3713 3715 } 3714 3716 else if ((ret = CRYPT_AsnDecodeOctetsInternal(pbEncoded, cbEncoded, 3715 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) )3717 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE) 3716 3718 { 3717 3719 if (!pvStructInfo) 3718 3720 *pcbStructInfo = bytesNeeded; 3719 3721 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 3720 pvStructInfo, pcbStructInfo, bytesNeeded)) )3722 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 3721 3723 { 3722 3724 CRYPT_DATA_BLOB *blob; … … 3751 3753 pvStructInfo, *pcbStructInfo, pcbDecoded); 3752 3754 3753 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )3755 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 3754 3756 { 3755 3757 if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG) … … 3820 3822 } 3821 3823 else if ((ret = CRYPT_AsnDecodeBitsInternal(pbEncoded, cbEncoded, 3822 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) )3824 dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE) 3823 3825 { 3824 3826 if (!pvStructInfo) 3825 3827 *pcbStructInfo = bytesNeeded; 3826 3828 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 3827 pvStructInfo, pcbStructInfo, bytesNeeded)) )3829 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 3828 3830 { 3829 3831 CRYPT_BIT_BLOB *blob; … … 3865 3867 if (!pvStructInfo) 3866 3868 *pcbStructInfo = sizeof(int); 3867 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, sizeof(int))) )3869 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, sizeof(int))) != FALSE) 3868 3870 { 3869 3871 int val, i; … … 3917 3919 *pcbStructInfo = bytesNeeded; 3918 3920 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 3919 pvStructInfo, pcbStructInfo, bytesNeeded)) )3921 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 3920 3922 { 3921 3923 if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) … … 3943 3945 DWORD bytesNeeded, dataLen; 3944 3946 3945 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )3947 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 3946 3948 { 3947 3949 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 4003 4005 *pcbStructInfo = bytesNeeded; 4004 4006 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 4005 pvStructInfo, pcbStructInfo, bytesNeeded)) )4007 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 4006 4008 { 4007 4009 CRYPT_INTEGER_BLOB *blob; … … 4037 4039 DWORD bytesNeeded, dataLen; 4038 4040 4039 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )4041 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 4040 4042 { 4041 4043 BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); … … 4097 4099 4098 4100 if ((ret = CRYPT_AsnDecodeUnsignedIntegerInternal(pbEncoded, cbEncoded, 4099 dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) )4101 dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE) 4100 4102 { 4101 4103 if (!pvStructInfo) 4102 4104 *pcbStructInfo = bytesNeeded; 4103 4105 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 4104 pvStructInfo, pcbStructInfo, bytesNeeded)) )4106 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 4105 4107 { 4106 4108 CRYPT_INTEGER_BLOB *blob; … … 4171 4173 } 4172 4174 if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 4173 pvStructInfo, pcbStructInfo, sizeof(unsigned int))) )4175 pvStructInfo, pcbStructInfo, sizeof(unsigned int))) != FALSE) 4174 4176 { 4175 4177 if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) … … 4329 4331 *pcbStructInfo = sizeof(FILETIME); 4330 4332 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, 4331 sizeof(FILETIME))) )4333 sizeof(FILETIME))) != FALSE) 4332 4334 ret = SystemTimeToFileTime(&sysTime, 4333 4335 (FILETIME *)pvStructInfo); … … 4358 4360 *pcbStructInfo = bytesNeeded; 4359 4361 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, 4360 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) )4362 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 4361 4363 { 4362 4364 if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) … … 4437 4439 *pcbStructInfo = sizeof(FILETIME); 4438 4440 else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, 4439 sizeof(FILETIME))) )4441 sizeof(FILETIME))) != FALSE) 4440 4442 ret = SystemTimeToFileTime(&sysTime, 4441 4443 (FILETIME *)pvStructInfo); … … 4488 4490 *pcbStructInfo = bytesNeeded; 4489 4491 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 4490 pvStructInfo, pcbStructInfo, bytesNeeded)) )4492 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 4491 4493 { 4492 4494 if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) … … 4519 4521 DWORD bytesNeeded, dataLen, remainingLen, cValue; 4520 4522 4521 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )4523 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 4522 4524 { 4523 4525 BYTE lenBytes; … … 4555 4557 *pcbStructInfo = bytesNeeded; 4556 4558 else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, 4557 pvStructInfo, pcbStructInfo, bytesNeeded)) )4559 pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE) 4558 4560 { 4559 4561 if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) … … 4622 4624 DWORD bytesNeeded, dataLen; 4623 4625 4624 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) )4626 if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE) 4625 4627 { 4626 4628 struct AsnArrayDescriptor arrayDesc = { -
trunk/src/crypt32/encode.c
r21311 r21354 38 38 #include <stdio.h> 39 39 #include <stdlib.h> 40 #include <string.h> 40 41 41 42 #define NONAMELESSUNION … … 111 112 *(BYTE **)pbEncoded = pEncodePara->pfnAlloc(bytesNeeded); 112 113 else 113 *(BYTE **)pbEncoded = LocalAlloc(0, bytesNeeded);114 *(BYTE **)pbEncoded = (BYTE*)LocalAlloc(0, bytesNeeded); 114 115 if (!*(BYTE **)pbEncoded) 115 116 ret = FALSE; … … 200 201 { 201 202 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 202 pcbEncoded, bytesNeeded)) )203 pcbEncoded, bytesNeeded)) != FALSE) 203 204 { 204 205 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 234 235 235 236 if ((ret = item->encodeFunc(dwCertEncodingType, lpszStructType, 236 item->pvStructInfo, dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, NULL, &len)) )237 item->pvStructInfo, dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, NULL, &len)) != FALSE) 237 238 { 238 239 DWORD dataLen, bytesNeeded; … … 243 244 *pcbEncoded = bytesNeeded; 244 245 else if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 245 pbEncoded, pcbEncoded, bytesNeeded)) )246 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 246 247 { 247 248 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 332 333 { 333 334 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 334 pcbEncoded, blob->cbData)) )335 pcbEncoded, blob->cbData)) != FALSE) 335 336 { 336 337 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 594 595 { 595 596 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 596 pcbEncoded, bytesNeeded)) )597 pcbEncoded, bytesNeeded)) != FALSE) 597 598 { 598 599 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 751 752 { 752 753 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 753 pbEncoded, pcbEncoded, bytesNeeded)) )754 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 754 755 { 755 756 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 909 910 { 910 911 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 911 pbEncoded, pcbEncoded, bytesNeeded)) )912 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 912 913 { 913 914 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 943 944 { 944 945 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 945 pbEncoded, pcbEncoded, bytesNeeded)) )946 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 946 947 { 947 948 DWORD i; … … 981 982 { 982 983 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 983 pbEncoded, pcbEncoded, bytesNeeded)) )984 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 984 985 { 985 986 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1171 1172 } 1172 1173 else if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1173 pbEncoded, pcbEncoded, bytesNeeded)) )1174 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1174 1175 { 1175 1176 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1249 1250 *pcbEncoded = bytesNeeded; 1250 1251 else if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1251 pbEncoded, pcbEncoded, bytesNeeded)) )1252 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1252 1253 { 1253 1254 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1383 1384 { 1384 1385 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1385 pbEncoded, pcbEncoded, bytesNeeded)) )1386 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1386 1387 { 1387 1388 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1517 1518 { 1518 1519 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1519 pbEncoded, pcbEncoded, bytesNeeded)) )1520 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1520 1521 { 1521 1522 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1669 1670 { 1670 1671 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1671 pbEncoded, pcbEncoded, bytesNeeded)) )1672 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1672 1673 { 1673 1674 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1724 1725 { 1725 1726 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 1726 pcbEncoded, bytesNeeded)) )1727 pcbEncoded, bytesNeeded)) != FALSE) 1727 1728 { 1728 1729 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 1947 1948 { 1948 1949 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1949 pbEncoded, pcbEncoded, bytesNeeded)) )1950 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1950 1951 { 1951 1952 DWORD i; … … 1968 1969 pEncodePara->pfnFree(pv); 1969 1970 else 1970 LocalFree( pv);1971 LocalFree((HANDLE)pv); 1971 1972 } 1972 1973 … … 1988 1989 { 1989 1990 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 1990 pbEncoded, pcbEncoded, bytesNeeded)) )1991 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 1991 1992 { 1992 1993 DWORD i; … … 2042 2043 { 2043 2044 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2044 pbEncoded, pcbEncoded, bytesNeeded)) )2045 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2045 2046 { 2046 2047 DWORD i; … … 2089 2090 { 2090 2091 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2091 pbEncoded, pcbEncoded, bytesNeeded)) )2092 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2092 2093 { 2093 2094 DWORD i; … … 2137 2138 { 2138 2139 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2139 pbEncoded, pcbEncoded, bytesNeeded)) )2140 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2140 2141 { 2141 2142 DWORD i; … … 2260 2261 { 2261 2262 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2262 pbEncoded, pcbEncoded, bytesNeeded)) )2263 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2263 2264 { 2264 2265 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 2571 2572 { 2572 2573 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2573 pbEncoded, pcbEncoded, bytesNeeded)) )2574 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2574 2575 { 2575 2576 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 2707 2708 { 2708 2709 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2709 pbEncoded, pcbEncoded, bytesNeeded)) )2710 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2710 2711 { 2711 2712 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 2856 2857 { 2857 2858 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2858 pbEncoded, pcbEncoded, bytesNeeded)) )2859 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2859 2860 { 2860 2861 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 2937 2938 { 2938 2939 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 2939 pbEncoded, pcbEncoded, bytesNeeded)) )2940 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 2940 2941 { 2941 2942 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3034 3035 { 3035 3036 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 3036 pcbEncoded, bytesNeeded)) )3037 pcbEncoded, bytesNeeded)) != FALSE) 3037 3038 { 3038 3039 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3095 3096 { 3096 3097 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 3097 pcbEncoded, bytesNeeded)) )3098 pcbEncoded, bytesNeeded)) != FALSE) 3098 3099 { 3099 3100 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3234 3235 { 3235 3236 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 3236 pcbEncoded, bytesNeeded)) )3237 pcbEncoded, bytesNeeded)) != FALSE) 3237 3238 { 3238 3239 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3304 3305 { 3305 3306 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 3306 pcbEncoded, bytesNeeded)) )3307 pcbEncoded, bytesNeeded)) != FALSE) 3307 3308 { 3308 3309 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3388 3389 { 3389 3390 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 3390 pbEncoded, pcbEncoded, bytesNeeded)) )3391 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 3391 3392 { 3392 3393 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3516 3517 { 3517 3518 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 3518 pcbEncoded, bytesNeeded)) )3519 pcbEncoded, bytesNeeded)) != FALSE) 3519 3520 { 3520 3521 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3647 3648 { 3648 3649 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 3649 pbEncoded, pcbEncoded, bytesNeeded)) )3650 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 3650 3651 { 3651 3652 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3710 3711 { 3711 3712 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, 3712 pbEncoded, pcbEncoded, bytesNeeded)) )3713 pbEncoded, pcbEncoded, bytesNeeded)) != FALSE) 3713 3714 { 3714 3715 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 3953 3954 dwFlags, pEncodePara, pbEncoded, pcbEncoded); 3954 3955 for (i = 0; i < permitted.cBlob; i++) 3955 LocalFree( permitted.rgBlob[i].pbData);3956 LocalFree((HANDLE)permitted.rgBlob[i].pbData); 3956 3957 for (i = 0; i < excluded.cBlob; i++) 3957 LocalFree( excluded.rgBlob[i].pbData);3958 LocalFree((HANDLE)excluded.rgBlob[i].pbData); 3958 3959 } 3959 3960 __EXCEPT(1) … … 4548 4549 if (!pszPublicKeyObjId) 4549 4550 pszPublicKeyObjId = oid; 4550 if ((ret = CryptGetUserKey(hCryptProv, dwKeySpec, &key)) )4551 if ((ret = CryptGetUserKey(hCryptProv, dwKeySpec, &key)) != FALSE) 4551 4552 { 4552 4553 DWORD keySize = 0; -
trunk/src/crypt32/filestore.c
r21311 r21354 43 43 if (store->dirty) 44 44 CertSaveStore(store->memStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 45 store->type, CERT_STORE_SAVE_TO_FILE, store->file, 0);45 store->type, CERT_STORE_SAVE_TO_FILE, (void*)store->file, 0); 46 46 CertCloseStore(store->memStore, dwFlags); 47 47 CloseHandle(store->file); … … 186 186 ret = CertSaveStore(store->memStore, 187 187 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 188 store->type, CERT_STORE_SAVE_TO_FILE, store->file, 0);188 store->type, CERT_STORE_SAVE_TO_FILE, (void*)store->file, 0); 189 189 else 190 190 ret = TRUE; … … 198 198 199 199 static void *fileProvFuncs[] = { 200 CRYPT_FileCloseStore,200 (void*)CRYPT_FileCloseStore, 201 201 NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ 202 CRYPT_FileWriteCert,203 CRYPT_FileDeleteCert,202 (void*)CRYPT_FileWriteCert, 203 (void*)CRYPT_FileDeleteCert, 204 204 NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ 205 205 NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ 206 CRYPT_FileWriteCRL,207 CRYPT_FileDeleteCRL,206 (void*)CRYPT_FileWriteCRL, 207 (void*)CRYPT_FileDeleteCRL, 208 208 NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ 209 209 NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ 210 CRYPT_FileWriteCTL,211 CRYPT_FileDeleteCTL,210 (void*)CRYPT_FileWriteCTL, 211 (void*)CRYPT_FileDeleteCTL, 212 212 NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */ 213 CRYPT_FileControl,213 (void*)CRYPT_FileControl, 214 214 }; 215 215 -
trunk/src/crypt32/main.c
r21325 r21354 21 21 #include <stdarg.h> 22 22 #include <stdio.h> 23 #include <string.h> 23 24 24 25 #include "windef.h" -
trunk/src/crypt32/makefile
r21321 r21354 18 18 # Overrides. 19 19 # 20 CDEFINES = $(CDEFINES) -DWIN32 -DSTDARG -DTHINK_C 20 #/*RLW - neither Think_C nor StdArg are referenced anywhere 21 #CDEFINES = $(CDEFINES) -DWIN32 -DSTDARG -DTHINK_C 22 CDEFINES = $(CDEFINES) -DWIN32 21 23 22 24 # -
trunk/src/crypt32/message.c
r21311 r21354 18 18 19 19 #include <stdarg.h> 20 #include <string.h> 20 21 #include "windef.h" 21 22 #include "winbase.h" -
trunk/src/crypt32/msg.c
r21311 r21354 21 21 22 22 #include <stdarg.h> 23 #include <string.h> 23 24 #define NONAMELESSUNION 24 25 #include "windef.h" … … 113 114 114 115 if (msg->bare_content != empty_data_content) 115 LocalFree( msg->bare_content);116 LocalFree((HANDLE)msg->bare_content); 116 117 } 117 118 … … 134 135 { 135 136 if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, 136 pcbEncoded, 1 + lenBytes)) )137 pcbEncoded, 1 + lenBytes)) != FALSE) 137 138 { 138 139 if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) … … 156 157 0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x80,0x24,0x80 }; 157 158 158 header->pbData = LocalAlloc(0, sizeof(headerValue));159 header->pbData = (BYTE*)LocalAlloc(0, sizeof(headerValue)); 159 160 if (header->pbData) 160 161 { … … 211 212 msg->base.stream_info.pvArg, header.pbData, header.cbData, 212 213 FALSE); 213 LocalFree( header.pbData);214 LocalFree((HANDLE)header.pbData); 214 215 } 215 216 } … … 230 231 msg->base.stream_info.pvArg, header, headerLen, 231 232 FALSE); 232 LocalFree( header);233 LocalFree((HANDLE)header); 233 234 } 234 235 } … … 437 438 pcbData); 438 439 CryptMemFree(digestedData.hash.pbData); 439 LocalFree( digestedData.ContentInfo.Content.pbData);440 LocalFree((HANDLE)digestedData.ContentInfo.Content.pbData); 440 441 } 441 442 return ret; … … 1039 1040 &msg_data->info->rgSignerInfo[signerIndex].AuthAttrs, 1040 1041 &messageDigestAttr); 1041 LocalFree( encodedHash.pbData);1042 LocalFree((HANDLE)encodedHash.pbData); 1042 1043 } 1043 1044 } … … 1093 1094 msg_data->signerHandles[i].authAttrHash, encodedAttrs, 1094 1095 size, 0); 1095 LocalFree( encodedAttrs);1096 LocalFree((HANDLE)encodedAttrs); 1096 1097 } 1097 1098 } … … 1253 1254 { 1254 1255 ret = CRYPT_AsnEncodeCMSSignedInfo(&info, pvData, pcbData); 1255 LocalFree( info.content.Content.pbData);1256 LocalFree((HANDLE)info.content.Content.pbData); 1256 1257 } 1257 1258 break; … … 1495 1496 if (msg->u.signed_data.info) 1496 1497 { 1497 LocalFree( msg->u.signed_data.info);1498 LocalFree((HANDLE)msg->u.signed_data.info); 1498 1499 CSignedMsgData_CloseHandles(&msg->u.signed_data); 1499 1500 } … … 1541 1542 ret = ContextPropertyList_SetProperty(msg->properties, 1542 1543 CMSG_CONTENT_PARAM, data->pbData, data->cbData); 1543 LocalFree( data);1544 LocalFree((HANDLE)data); 1544 1545 } 1545 1546 return ret; … … 1620 1621 ContextPropertyList_SetProperty(msg->properties, CMSG_HASH_DATA_PARAM, 1621 1622 digestedData->hash.pbData, digestedData->hash.cbData); 1622 LocalFree( digestedData);1623 LocalFree((HANDLE)digestedData); 1623 1624 } 1624 1625 return ret; … … 1653 1654 { 1654 1655 case CMSG_DATA: 1655 if ((ret = CDecodeMsg_DecodeDataContent(msg, blob)) )1656 if ((ret = CDecodeMsg_DecodeDataContent(msg, blob)) != FALSE) 1656 1657 msg->type = CMSG_DATA; 1657 1658 break; 1658 1659 case CMSG_HASHED: 1659 if ((ret = CDecodeMsg_DecodeHashedContent(msg, blob)) )1660 if ((ret = CDecodeMsg_DecodeHashedContent(msg, blob)) != FALSE) 1660 1661 msg->type = CMSG_HASHED; 1661 1662 break; … … 1665 1666 break; 1666 1667 case CMSG_SIGNED: 1667 if ((ret = CDecodeMsg_DecodeSignedContent(msg, blob)) )1668 if ((ret = CDecodeMsg_DecodeSignedContent(msg, blob)) != FALSE) 1668 1669 msg->type = CMSG_SIGNED; 1669 1670 break; … … 1694 1695 ret = FALSE; 1695 1696 } 1696 LocalFree( info);1697 LocalFree((HANDLE)info); 1697 1698 } 1698 1699 } … … 1779 1780 ret = CSignedMsgData_Update(&msg->u.signed_data, 1780 1781 blob->pbData, blob->cbData, TRUE, Verify); 1781 LocalFree( blob);1782 LocalFree((HANDLE)blob); 1782 1783 } 1783 1784 } … … 2283 2284 ret = CRYPT_CopyParam(pvData, pcbData, blob->pbData, 2284 2285 blob->cbData); 2285 LocalFree( blob);2286 LocalFree((HANDLE)blob); 2286 2287 } 2287 2288 } -
trunk/src/crypt32/object.c
r21311 r21354 19 19 */ 20 20 #include <stdarg.h> 21 #include <string.h> 21 22 #define NONAMELESSUNION 22 23 #include "windef.h" … … 694 695 } 695 696 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_KEY_USAGE, 696 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size)) )697 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size)) != FALSE) 697 698 { 698 699 WCHAR infoNotAvailable[MAX_STRING_RESOURCE_LEN]; … … 791 792 } 792 793 } 793 LocalFree( bits);794 LocalFree((HANDLE)bits); 794 795 } 795 796 return ret; … … 818 819 } 819 820 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_BASIC_CONSTRAINTS2, 820 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) )821 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) != FALSE) 821 822 { 822 823 static const WCHAR pathFmt[] = { '%','d',0 }; … … 889 890 str += strlenW(pathLength); 890 891 } 891 LocalFree( info);892 LocalFree((HANDLE)info); 892 893 } 893 894 return ret; … … 1203 1204 1204 1205 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_ALTERNATE_NAME, 1205 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) )1206 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) != FALSE) 1206 1207 { 1207 1208 ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 0, info, pbFormat, pcbFormat); 1208 LocalFree( info);1209 LocalFree((HANDLE)info); 1209 1210 } 1210 1211 return ret; … … 1274 1275 } 1275 1276 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_AUTHORITY_KEY_ID2, 1276 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) )1277 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) != FALSE) 1277 1278 { 1278 1279 DWORD bytesNeeded = sizeof(WCHAR); /* space for the NULL terminator */ … … 1387 1388 } 1388 1389 } 1389 LocalFree( info);1390 LocalFree((HANDLE)info); 1390 1391 } 1391 1392 return ret; … … 1415 1416 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, 1416 1417 X509_AUTHORITY_INFO_ACCESS, pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, 1417 NULL, &info, &size)) )1418 NULL, &info, &size)) != FALSE) 1418 1419 { 1419 1420 DWORD bytesNeeded = sizeof(WCHAR); … … 1607 1608 } 1608 1609 } 1609 LocalFree( info);1610 LocalFree((HANDLE)info); 1610 1611 } 1611 1612 return ret; … … 1721 1722 } 1722 1723 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CRL_DIST_POINTS, 1723 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) )1724 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size)) != FALSE) 1724 1725 { 1725 1726 static const WCHAR numFmt[] = { '%','d',0 }; … … 1934 1935 } 1935 1936 } 1936 LocalFree( info);1937 LocalFree((HANDLE)info); 1937 1938 } 1938 1939 return ret; … … 1954 1955 } 1955 1956 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_ENHANCED_KEY_USAGE, 1956 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &usage, &size)) )1957 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &usage, &size)) != FALSE) 1957 1958 { 1958 1959 WCHAR unknown[MAX_STRING_RESOURCE_LEN]; … … 2035 2036 } 2036 2037 } 2037 LocalFree( usage);2038 LocalFree((HANDLE)usage); 2038 2039 } 2039 2040 return ret; … … 2065 2066 } 2066 2067 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_BITS, 2067 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size)) )2068 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size)) != FALSE) 2068 2069 { 2069 2070 WCHAR infoNotAvailable[MAX_STRING_RESOURCE_LEN]; … … 2141 2142 } 2142 2143 } 2143 LocalFree( bits);2144 LocalFree((HANDLE)bits); 2144 2145 } 2145 2146 return ret; … … 2169 2170 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, 2170 2171 SPC_FINANCIAL_CRITERIA_STRUCT, pbEncoded, cbEncoded, 0, NULL, &criteria, 2171 &size)) )2172 &size)) != FALSE) 2172 2173 { 2173 2174 static BOOL stringsLoaded = FALSE; … … 2266 2267 } 2267 2268 if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_UNICODE_ANY_STRING, 2268 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &value, &size)) )2269 pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &value, &size)) != FALSE) 2269 2270 { 2270 2271 if (!pbFormat) -
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 } -
trunk/src/crypt32/proplist.c
r21311 r21354 18 18 #include <assert.h> 19 19 #include <stdarg.h> 20 #include <string.h> 20 21 #include "windef.h" 21 22 #include "winbase.h" … … 47 48 if (list) 48 49 { 49 InitializeCriticalSection( &list->cs);50 list->cs.DebugInfo->Spare[0] = (DWORD _PTR)(__FILE__ ": PCONTEXT_PROPERTY_LIST->cs");50 InitializeCriticalSection((CRITICAL_SECTION*)&list->cs); 51 list->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PCONTEXT_PROPERTY_LIST->cs"); 51 52 list_init(&list->properties); 52 53 } … … 66 67 } 67 68 list->cs.DebugInfo->Spare[0] = 0; 68 DeleteCriticalSection( &list->cs);69 DeleteCriticalSection((CRITICAL_SECTION*)&list->cs); 69 70 CryptMemFree(list); 70 71 } … … 78 79 TRACE("(%p, %d, %p)\n", list, id, blob); 79 80 80 EnterCriticalSection( &list->cs);81 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 81 82 LIST_FOR_EACH_ENTRY(prop, &list->properties, CONTEXT_PROPERTY, entry) 82 83 { … … 89 90 } 90 91 } 91 LeaveCriticalSection( &list->cs);92 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 92 93 return ret; 93 94 } … … 112 113 BOOL found = FALSE; 113 114 114 EnterCriticalSection( &list->cs);115 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 115 116 LIST_FOR_EACH_ENTRY(prop, &list->properties, CONTEXT_PROPERTY, entry) 116 117 { … … 142 143 CryptMemFree(data); 143 144 } 144 LeaveCriticalSection( &list->cs);145 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 145 146 } 146 147 return ret; … … 151 152 PCONTEXT_PROPERTY prop, next; 152 153 153 EnterCriticalSection( &list->cs);154 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 154 155 LIST_FOR_EACH_ENTRY_SAFE(prop, next, &list->properties, CONTEXT_PROPERTY, 155 156 entry) … … 163 164 } 164 165 } 165 LeaveCriticalSection( &list->cs);166 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 166 167 } 167 168 … … 173 174 DWORD ret; 174 175 175 EnterCriticalSection( &list->cs);176 EnterCriticalSection((CRITICAL_SECTION*)&list->cs); 176 177 if (id) 177 178 { … … 199 200 else 200 201 ret = 0; 201 LeaveCriticalSection( &list->cs);202 LeaveCriticalSection((CRITICAL_SECTION*)&list->cs); 202 203 return ret; 203 204 } … … 208 209 PCONTEXT_PROPERTY prop; 209 210 210 EnterCriticalSection( &from->cs);211 EnterCriticalSection((CRITICAL_SECTION*)&from->cs); 211 212 LIST_FOR_EACH_ENTRY(prop, &from->properties, CONTEXT_PROPERTY, entry) 212 213 { … … 214 215 prop->cbData); 215 216 } 216 LeaveCriticalSection( &from->cs);217 } 217 LeaveCriticalSection((CRITICAL_SECTION*)&from->cs); 218 } -
trunk/src/crypt32/protectdata.c
r21311 r21354 264 264 /*if (pSerial->cbData<256) pSerial->cbData=256;*/ 265 265 266 pSerial->pbData= LocalAlloc(LPTR,pSerial->cbData);266 pSerial->pbData=(BYTE*)LocalAlloc(LPTR,pSerial->cbData); 267 267 if (!pSerial->pbData) return FALSE; 268 268 … … 338 338 ERR("struct size changed!? %u != expected %u\n", 339 339 ptr - pSerial->pbData, dwStruct); 340 LocalFree( pSerial->pbData);340 LocalFree((HANDLE)pSerial->pbData); 341 341 pSerial->pbData=NULL; 342 342 pSerial->cbData=0; … … 410 410 411 411 /* cipher_alg */ 412 if (!unserialize_dword(ptr,&index,size, &pInfo->cipher_alg))412 if (!unserialize_dword(ptr,&index,size,(DWORD*)&pInfo->cipher_alg)) 413 413 { 414 414 ERR("reading cipher_alg failed!\n"); … … 439 439 440 440 /* hash_alg */ 441 if (!unserialize_dword(ptr,&index,size, &pInfo->hash_alg))441 if (!unserialize_dword(ptr,&index,size,(DWORD*)&pInfo->hash_alg)) 442 442 { 443 443 ERR("reading hash_alg failed!\n"); … … 598 598 pInfo->null0=0x0000; 599 599 600 if ((pInfo->szDataDescr=CryptMemAlloc((dwStrLen+1)*sizeof(WCHAR))) )600 if ((pInfo->szDataDescr=CryptMemAlloc((dwStrLen+1)*sizeof(WCHAR))) != NULL) 601 601 { 602 602 memcpy(pInfo->szDataDescr,szDataDescr,(dwStrLen+1)*sizeof(WCHAR)); … … 613 613 614 614 /* allocate memory to hold a salt */ 615 if ((pInfo->salt.pbData=CryptMemAlloc(CRYPT32_PROTECTDATA_SALT_LEN)) )615 if ((pInfo->salt.pbData=CryptMemAlloc(CRYPT32_PROTECTDATA_SALT_LEN)) != NULL) 616 616 { 617 617 /* generate random salt */ … … 794 794 { 795 795 TRACE_DATA_BLOB(pOptionalEntropy); 796 TRACE(" %s\n", debugstr_an((LPCSTR)pOptionalEntropy->pbData,pOptionalEntropy->cbData));796 TRACE(" %s\n", debugstr_an((LPCSTR)pOptionalEntropy->pbData,pOptionalEntropy->cbData)); 797 797 } 798 798 … … 1071 1071 /* prepare for plaintext */ 1072 1072 pDataOut->cbData=protect_data.cipher.cbData; 1073 if (!(pDataOut->pbData= LocalAlloc( LPTR, pDataOut->cbData)))1073 if (!(pDataOut->pbData=(BYTE*)LocalAlloc( LPTR, pDataOut->cbData))) 1074 1074 { 1075 1075 ERR("CryptMemAlloc\n"); … … 1087 1087 SetLastError(ERROR_INVALID_DATA); 1088 1088 1089 LocalFree( 1089 LocalFree((HANDLE)pDataOut->pbData ); 1090 1090 pDataOut->pbData = NULL; 1091 1091 pDataOut->cbData = 0; … … 1098 1098 if (ppszDataDescr) 1099 1099 { 1100 if (!(*ppszDataDescr = LocalAlloc(LPTR,dwLength)))1100 if (!(*ppszDataDescr = (LPWSTR)LocalAlloc(LPTR,dwLength))) 1101 1101 { 1102 1102 ERR("LocalAlloc (ppszDataDescr)\n"); -
trunk/src/crypt32/provstore.c
r21311 r21354 292 292 ret->hdr.control = CRYPT_ProvControl; 293 293 if (pProvInfo->cStoreProvFunc > CERT_STORE_PROV_CLOSE_FUNC) 294 ret->provCloseStore = 294 ret->provCloseStore = (PFN_CERT_STORE_PROV_CLOSE) 295 295 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_CLOSE_FUNC]; 296 296 else … … 298 298 if (pProvInfo->cStoreProvFunc > 299 299 CERT_STORE_PROV_WRITE_CERT_FUNC) 300 ret->provWriteCert = pProvInfo->rgpvStoreProvFunc[301 CERT_STORE_PROV_WRITE_CERT_FUNC];300 ret->provWriteCert = (PFN_CERT_STORE_PROV_WRITE_CERT) 301 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_WRITE_CERT_FUNC]; 302 302 else 303 303 ret->provWriteCert = NULL; 304 304 if (pProvInfo->cStoreProvFunc > 305 305 CERT_STORE_PROV_DELETE_CERT_FUNC) 306 ret->provDeleteCert = pProvInfo->rgpvStoreProvFunc[307 CERT_STORE_PROV_DELETE_CERT_FUNC];306 ret->provDeleteCert = (PFN_CERT_STORE_PROV_DELETE_CERT) 307 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_DELETE_CERT_FUNC]; 308 308 else 309 309 ret->provDeleteCert = NULL; 310 310 if (pProvInfo->cStoreProvFunc > 311 311 CERT_STORE_PROV_WRITE_CRL_FUNC) 312 ret->provWriteCrl = pProvInfo->rgpvStoreProvFunc[313 CERT_STORE_PROV_WRITE_CRL_FUNC];312 ret->provWriteCrl = (PFN_CERT_STORE_PROV_WRITE_CRL) 313 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_WRITE_CRL_FUNC]; 314 314 else 315 315 ret->provWriteCrl = NULL; 316 316 if (pProvInfo->cStoreProvFunc > 317 317 CERT_STORE_PROV_DELETE_CRL_FUNC) 318 ret->provDeleteCrl = pProvInfo->rgpvStoreProvFunc[319 CERT_STORE_PROV_DELETE_CRL_FUNC];318 ret->provDeleteCrl = (PFN_CERT_STORE_PROV_DELETE_CRL) 319 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_DELETE_CRL_FUNC]; 320 320 else 321 321 ret->provDeleteCrl = NULL; 322 322 if (pProvInfo->cStoreProvFunc > 323 323 CERT_STORE_PROV_WRITE_CTL_FUNC) 324 ret->provWriteCtl = pProvInfo->rgpvStoreProvFunc[325 CERT_STORE_PROV_WRITE_CTL_FUNC];324 ret->provWriteCtl = (PFN_CERT_STORE_PROV_WRITE_CTL) 325 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_WRITE_CTL_FUNC]; 326 326 else 327 327 ret->provWriteCtl = NULL; 328 328 if (pProvInfo->cStoreProvFunc > 329 329 CERT_STORE_PROV_DELETE_CTL_FUNC) 330 ret->provDeleteCtl = pProvInfo->rgpvStoreProvFunc[331 CERT_STORE_PROV_DELETE_CTL_FUNC];330 ret->provDeleteCtl = (PFN_CERT_STORE_PROV_DELETE_CTL) 331 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_DELETE_CTL_FUNC]; 332 332 else 333 333 ret->provDeleteCtl = NULL; 334 334 if (pProvInfo->cStoreProvFunc > 335 335 CERT_STORE_PROV_CONTROL_FUNC) 336 ret->provControl = pProvInfo->rgpvStoreProvFunc[337 CERT_STORE_PROV_CONTROL_FUNC];336 ret->provControl = (PFN_CERT_STORE_PROV_CONTROL) 337 pProvInfo->rgpvStoreProvFunc[CERT_STORE_PROV_CONTROL_FUNC]; 338 338 else 339 339 ret->provControl = NULL; -
trunk/src/crypt32/regstore.c
r21311 r21354 194 194 if (!rc) 195 195 { 196 rc = RegSetValueExW(subKey, BlobW, 0, REG_BINARY, buf, len);196 rc = RegSetValueExW(subKey, BlobW, 0, REG_BINARY, (BYTE*)buf, len); 197 197 RegCloseKey(subKey); 198 198 } … … 270 270 WCHAR asciiHash[20 * 2 + 1]; 271 271 272 EnterCriticalSection( &store->cs);272 EnterCriticalSection((CRITICAL_SECTION*)&store->cs); 273 273 LIST_FOR_EACH_ENTRY_SAFE(toDelete, next, listToDelete[i], 274 274 WINE_HASH_TO_DELETE, entry) … … 287 287 CryptMemFree(toDelete); 288 288 } 289 LeaveCriticalSection( &store->cs);289 LeaveCriticalSection((CRITICAL_SECTION*)&store->cs); 290 290 } 291 291 ret = CRYPT_SerializeContextsToReg(key, interfaces[i], … … 329 329 RegCloseKey(store->key); 330 330 store->cs.DebugInfo->Spare[0] = 0; 331 DeleteCriticalSection( &store->cs);331 DeleteCriticalSection((CRITICAL_SECTION*)&store->cs); 332 332 CryptMemFree(store); 333 333 } … … 372 372 if (ret) 373 373 { 374 EnterCriticalSection( &store->cs);374 EnterCriticalSection((CRITICAL_SECTION*)&store->cs); 375 375 list_add_tail(deleteList, &toDelete->entry); 376 LeaveCriticalSection( &store->cs);376 LeaveCriticalSection((CRITICAL_SECTION*)&store->cs); 377 377 } 378 378 else … … 488 488 489 489 static void *regProvFuncs[] = { 490 CRYPT_RegCloseStore,490 (void*)CRYPT_RegCloseStore, 491 491 NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ 492 CRYPT_RegWriteCert,493 CRYPT_RegDeleteCert,492 (void*)CRYPT_RegWriteCert, 493 (void*)CRYPT_RegDeleteCert, 494 494 NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ 495 495 NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ 496 CRYPT_RegWriteCRL,497 CRYPT_RegDeleteCRL,496 (void*)CRYPT_RegWriteCRL, 497 (void*)CRYPT_RegDeleteCRL, 498 498 NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ 499 499 NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ 500 CRYPT_RegWriteCTL,501 CRYPT_RegDeleteCTL,500 (void*)CRYPT_RegWriteCTL, 501 (void*)CRYPT_RegDeleteCTL, 502 502 NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */ 503 CRYPT_RegControl,503 (void*)CRYPT_RegControl, 504 504 }; 505 505 … … 548 548 regInfo->memStore = memStore; 549 549 regInfo->key = key; 550 InitializeCriticalSection( ®Info->cs);551 regInfo->cs.DebugInfo->Spare[0] = (DWORD _PTR)(__FILE__ ": PWINE_REGSTOREINFO->cs");550 InitializeCriticalSection((CRITICAL_SECTION*)®Info->cs); 551 regInfo->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PWINE_REGSTOREINFO->cs"); 552 552 list_init(®Info->certsToDelete); 553 553 list_init(®Info->crlsToDelete); -
trunk/src/crypt32/rootstore.c
r21325 r21354 16 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 17 */ 18 18 19 #include <os2win.h> 19 20 #include <odinwrap.h> … … 22 23 #include <stdarg.h> 23 24 #include <stdio.h> 25 #include <string.h> 24 26 #include <sys/types.h> 25 27 #include <sys/stat.h> … … 28 30 #endif 29 31 #include <fcntl.h> 32 #if __IBMC__ || __IBMCPP__ 33 #include <io.h> 34 #endif 30 35 #ifdef HAVE_UNISTD_H 31 36 #include <unistd.h> … … 229 234 name = buf; 230 235 } 231 LocalFree( nameInfo);236 LocalFree((HANDLE)nameInfo); 232 237 } 233 238 return name; … … 299 304 TRACE("\n"); 300 305 301 fp = odin_fdopen(fd, "r");306 fp = fdopen(fd, "r"); 302 307 if (fp) 303 308 { … … 426 431 NULL, /* CERT_STORE_PROV_CLOSE_FUNC */ 427 432 NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ 428 CRYPT_RootWriteCert,429 CRYPT_RootDeleteCert,433 (void*)CRYPT_RootWriteCert, 434 (void*)CRYPT_RootDeleteCert, 430 435 NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ 431 436 NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ 432 CRYPT_RootWriteCRL,433 CRYPT_RootDeleteCRL,437 (void*)CRYPT_RootWriteCRL, 438 (void*)CRYPT_RootDeleteCRL, 434 439 NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ 435 440 NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ -
trunk/src/crypt32/serialize.c
r21311 r21354 21 21 22 22 #include <stdarg.h> 23 #include <string.h> 23 24 #include "windef.h" 24 25 #include "winbase.h" … … 615 616 static BOOL CRYPT_FileOutputFunc(void *handle, const void *buffer, DWORD size) 616 617 { 617 return WriteFile( handle, buffer, size, &size, NULL);618 return WriteFile((HANDLE)handle, buffer, size, &size, NULL); 618 619 } 619 620 … … 622 623 SetFilePointer(file, 0, NULL, FILE_BEGIN); 623 624 return CRYPT_WriteSerializedStoreToStream(store, CRYPT_FileOutputFunc, 624 file);625 (void*)file); 625 626 } 626 627 … … 739 740 ret = CRYPT_SavePKCSToMem(store, dwMsgAndCertEncodingType, &blob); 740 741 if (ret) 741 ret = WriteFile( handle, blob.pbData, blob.cbData,742 ret = WriteFile((HANDLE)handle, blob.pbData, blob.cbData, 742 743 &blob.cbData, NULL); 743 744 } … … 755 756 DWORD dwMsgAndCertEncodingType, void *handle) 756 757 { 757 return CRYPT_WriteSerializedStoreToFile( handle, store);758 return CRYPT_WriteSerializedStoreToFile((HANDLE)handle, store); 758 759 } 759 760 … … 857 858 break; 858 859 case CERT_STORE_SAVE_TO_FILENAME_A: 859 handle = CreateFileA((LPCSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL,860 handle = (void*)CreateFileA((LPCSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL, 860 861 CREATE_ALWAYS, 0, NULL); 861 862 saveFunc = dwSaveAs == CERT_STORE_SAVE_AS_STORE ? … … 863 864 break; 864 865 case CERT_STORE_SAVE_TO_FILENAME_W: 865 handle = CreateFileW((LPCWSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL,866 handle = (void*)CreateFileW((LPCWSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL, 866 867 CREATE_ALWAYS, 0, NULL); 867 868 saveFunc = dwSaveAs == CERT_STORE_SAVE_AS_STORE ? -
trunk/src/crypt32/sip.c
r21311 r21354 21 21 #include <stdarg.h> 22 22 #include <stdio.h> 23 #include <string.h> 23 24 24 25 #define WINE_LARGE_INTEGER /* for QuadPart in LARGE_INTEGER */ … … 177 178 178 179 /* write the values */ 179 r = RegSetValueExW( hKey, szFuncName, 0, REG_SZ, ( constBYTE*) szFunction,180 r = RegSetValueExW( hKey, szFuncName, 0, REG_SZ, (BYTE*) szFunction, 180 181 ( lstrlenW( szFunction ) + 1 ) * sizeof (WCHAR) ); 181 182 if( r != ERROR_SUCCESS ) goto error_close_key; 182 r = RegSetValueExW( hKey, szDllName, 0, REG_SZ, ( constBYTE*) szDll,183 r = RegSetValueExW( hKey, szDllName, 0, REG_SZ, (BYTE*) szDll, 183 184 ( lstrlenW( szDll ) + 1) * sizeof (WCHAR) ); 184 185 … … 282 283 if (!lib) 283 284 goto end; 284 func = GetProcAddress(lib, functionName);285 func = (void*)GetProcAddress(lib, functionName); 285 286 if (func) 286 287 *pLib = lib; … … 456 457 { 457 458 HMODULE lib; 458 pfnIsFileSupported isMy = CRYPT_LoadSIPFuncFromKey(subKey,459 &lib);459 pfnIsFileSupported isMy = 460 (pfnIsFileSupported)CRYPT_LoadSIPFuncFromKey(subKey, &lib); 460 461 461 462 if (isMy) … … 494 495 { 495 496 HMODULE lib; 496 pfnIsFileSupportedName isMy2 = 497 pfnIsFileSupportedName isMy2 = (pfnIsFileSupportedName) 497 498 CRYPT_LoadSIPFuncFromKey(subKey, &lib); 498 499 … … 572 573 { &providers_cs_debug.ProcessLocksList, 573 574 &providers_cs_debug.ProcessLocksList }, 574 0, 0, { (DWORD _PTR)(__FILE__ ": providers_cs") }575 0, 0, { (DWORD)(DWORD_PTR)(__FILE__ ": providers_cs") } 575 576 }; 576 577 static RTL_CRITICAL_SECTION providers_cs = { &providers_cs_debug, -1, 0, 0, 0, 0 }; … … 584 585 prov->subject = *pgSubject; 585 586 prov->info = *info; 586 EnterCriticalSection( &providers_cs);587 EnterCriticalSection((CRITICAL_SECTION*)&providers_cs); 587 588 list_add_tail(&providers, &prov->entry); 588 LeaveCriticalSection( &providers_cs);589 LeaveCriticalSection((CRITICAL_SECTION*)&providers_cs); 589 590 } 590 591 } … … 594 595 WINE_SIP_PROVIDER *provider = NULL, *ret = NULL; 595 596 596 EnterCriticalSection( &providers_cs);597 EnterCriticalSection((CRITICAL_SECTION*)&providers_cs); 597 598 LIST_FOR_EACH_ENTRY(provider, &providers, WINE_SIP_PROVIDER, entry) 598 599 { … … 602 603 if (provider && IsEqualGUID(pgSubject, &provider->subject)) 603 604 ret = provider; 604 LeaveCriticalSection( &providers_cs);605 LeaveCriticalSection((CRITICAL_SECTION*)&providers_cs); 605 606 return ret; 606 607 } … … 631 632 HMODULE lib = NULL, temp = NULL; 632 633 633 sip.pfGet = CRYPT_LoadSIPFunc(pgSubject, szGetSigned, &lib);634 sip.pfGet = (pCryptSIPGetSignedDataMsg)CRYPT_LoadSIPFunc(pgSubject, szGetSigned, &lib); 634 635 if (!sip.pfGet) 635 636 goto error; 636 sip.pfPut = CRYPT_LoadSIPFunc(pgSubject, szPutSigned, &temp);637 sip.pfPut = (pCryptSIPPutSignedDataMsg)CRYPT_LoadSIPFunc(pgSubject, szPutSigned, &temp); 637 638 if (!sip.pfPut || temp != lib) 638 639 goto error; 639 640 FreeLibrary(temp); 640 sip.pfCreate = CRYPT_LoadSIPFunc(pgSubject, szCreate, &temp);641 sip.pfCreate = (pCryptSIPCreateIndirectData)CRYPT_LoadSIPFunc(pgSubject, szCreate, &temp); 641 642 if (!sip.pfCreate || temp != lib) 642 643 goto error; 643 644 FreeLibrary(temp); 644 sip.pfVerify = CRYPT_LoadSIPFunc(pgSubject, szVerify, &temp);645 sip.pfVerify = (pCryptSIPVerifyIndirectData)CRYPT_LoadSIPFunc(pgSubject, szVerify, &temp); 645 646 if (!sip.pfVerify || temp != lib) 646 647 goto error; 647 648 FreeLibrary(temp); 648 sip.pfRemove = CRYPT_LoadSIPFunc(pgSubject, szRemoveSigned, &temp);649 sip.pfRemove = (pCryptSIPRemoveSignedDataMsg)CRYPT_LoadSIPFunc(pgSubject, szRemoveSigned, &temp); 649 650 if (!sip.pfRemove || temp != lib) 650 651 goto error; … … 720 721 TRACE("(%p %p %p)\n", pSubjectInfo, pcbIndirectData, pIndirectData); 721 722 722 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) )723 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) != NULL) 723 724 ret = sip->info.pfCreate(pSubjectInfo, pcbIndirectData, pIndirectData); 724 725 TRACE("returning %d\n", ret); … … 738 739 pcbSignedDataMsg, pbSignedDataMsg); 739 740 740 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) )741 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) != NULL) 741 742 ret = sip->info.pfGet(pSubjectInfo, pdwEncodingType, dwIndex, 742 743 pcbSignedDataMsg, pbSignedDataMsg); … … 757 758 cbSignedDataMsg, pbSignedDataMsg); 758 759 759 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) )760 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) != NULL) 760 761 ret = sip->info.pfPut(pSubjectInfo, pdwEncodingType, pdwIndex, 761 762 cbSignedDataMsg, pbSignedDataMsg); … … 775 776 TRACE("(%p %d)\n", pSubjectInfo, dwIndex); 776 777 777 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) )778 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) != NULL) 778 779 ret = sip->info.pfRemove(pSubjectInfo, dwIndex); 779 780 TRACE("returning %d\n", ret); … … 792 793 TRACE("(%p %p)\n", pSubjectInfo, pIndirectData); 793 794 794 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) )795 if ((sip = CRYPT_GetCachedSIP(pSubjectInfo->pgSubjectType)) != NULL) 795 796 ret = sip->info.pfVerify(pSubjectInfo, pIndirectData); 796 797 TRACE("returning %d\n", ret); -
trunk/src/crypt32/store.c
r21311 r21354 29 29 #include <assert.h> 30 30 #include <stdarg.h> 31 #include <string.h> 31 32 #include "windef.h" 32 33 #include "winbase.h" … … 426 427 if (!rc) 427 428 { 428 store = CRYPT_RegOpenStore(hCryptProv, dwFlags, key);429 store = CRYPT_RegOpenStore(hCryptProv, dwFlags, (const void*)key); 429 430 RegCloseKey(key); 430 431 } … … 575 576 576 577 static void *msgProvFuncs[] = { 577 CRYPT_MsgCloseStore,578 (void*)CRYPT_MsgCloseStore, 578 579 }; 579 580 -
trunk/src/crypt32/str.c
r21311 r21354 17 17 */ 18 18 #include <stdarg.h> 19 #include <string.h> 20 #include <ctype.h> 19 21 #include "windef.h" 20 22 #include "winbase.h" … … 277 279 else rdn++; 278 280 } 279 LocalFree( info);281 LocalFree((HANDLE)info); 280 282 } 281 283 if (psz && csz) … … 457 459 else rdn++; 458 460 } 459 LocalFree( info);461 LocalFree((HANDLE)info); 460 462 } 461 463 if (psz && csz) … … 499 501 LPWSTR x500, errorStr; 500 502 501 if ((x500 = CryptMemAlloc(len * sizeof(WCHAR))) )503 if ((x500 = CryptMemAlloc(len * sizeof(WCHAR))) != NULL) 502 504 { 503 505 MultiByteToWideChar(CP_ACP, 0, pszX500, -1, x500, len); … … 746 748 BOOL ret = FALSE; 747 749 748 TRACE("OID %s, value %s\n", debugstr_a(keyOID->pszOID), 749 debugstr_wn(value->start, value->end - value->start)); 750 TRACE("OID %s, value %s\n", debugstr_a(keyOID->pszOID), debugstr_wn(value->start, value->end - value->start)); 750 751 751 752 if (!info->rgRDN) … … 882 883 883 884 for (j = 0; j < info.rgRDN[i].cRDNAttr; j++) 884 LocalFree( info.rgRDN[i].rgRDNAttr[j].Value.pbData);885 LocalFree((HANDLE)info.rgRDN[i].rgRDNAttr[j].Value.pbData); 885 886 CryptMemFree(info.rgRDN[i].rgRDNAttr); 886 887 } … … 998 999 ret = 0; 999 1000 if (info) 1000 LocalFree( info);1001 LocalFree((HANDLE)info); 1001 1002 break; 1002 1003 }
Note:
See TracChangeset
for help on using the changeset viewer.