Piotr Caban : crypt32: Don't use strncasecmp.
Alexandre Julliard
julliard at winehq.org
Wed Apr 3 15:26:20 CDT 2019
Module: wine
Branch: master
Commit: 57a8c4dbe8e2f48edf0f2d03aef826d542622964
URL: https://source.winehq.org/git/wine.git/?a=commit;h=57a8c4dbe8e2f48edf0f2d03aef826d542622964
Author: Piotr Caban <piotr at codeweavers.com>
Date: Wed Apr 3 18:20:30 2019 +0200
crypt32: Don't use strncasecmp.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/crypt32/cert.c | 2 +-
dlls/crypt32/oid.c | 5 +++--
dlls/crypt32/store.c | 15 ++++++++-------
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index 02693b9..48eaac0 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -2151,7 +2151,7 @@ static BOOL find_matching_rdn_attr(DWORD dwFlags, const CERT_NAME_INFO *name,
name->rgRDN[i].rgRDNAttr[j].Value.cbData)
match = FALSE;
else if (dwFlags & CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG)
- match = !strncasecmp(nameStr, attrStr,
+ match = !_strnicmp(nameStr, attrStr,
attr->Value.cbData);
else
match = !strncmp(nameStr, attrStr, attr->Value.cbData);
diff --git a/dlls/crypt32/oid.c b/dlls/crypt32/oid.c
index bf0ad32..94270c5 100644
--- a/dlls/crypt32/oid.c
+++ b/dlls/crypt32/oid.c
@@ -29,6 +29,7 @@
#define CRYPT_OID_INFO_HAS_EXTRA_FIELDS
#include "wincrypt.h"
#include "winreg.h"
+#include "winternl.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
@@ -118,7 +119,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName,
EnterCriticalSection(&funcSetCS);
LIST_FOR_EACH_ENTRY(cursor, &funcSets, struct OIDFunctionSet, next)
{
- if (!strcasecmp(pszFuncName, cursor->name))
+ if (!_strnicmp(pszFuncName, cursor->name, -1))
{
ret = cursor;
break;
@@ -403,7 +404,7 @@ BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
if (!IS_INTOID(pszOID))
{
if (!IS_INTOID(function->entry.pszOID) &&
- !strcasecmp(function->entry.pszOID, pszOID))
+ !_strnicmp(function->entry.pszOID, pszOID, -1))
{
*ppvFuncAddr = function->entry.pvFuncAddr;
*phFuncAddr = NULL; /* FIXME: what should it be? */
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 2b8ea1d..1c9ed91 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -32,6 +32,7 @@
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
+#include "winternl.h"
#include "winuser.h"
#include "wincrypt.h"
#include "wine/debug.h"
@@ -873,19 +874,19 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider,
FIXME("unimplemented type %d\n", LOWORD(lpszStoreProvider));
}
}
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY, -1))
openFunc = CRYPT_MemOpenStore;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_FILENAME_W))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_FILENAME_W, -1))
openFunc = CRYPT_FileOpenStore;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM, -1))
openFunc = CRYPT_SysOpenStoreW;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_PKCS7))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_PKCS7, -1))
openFunc = CRYPT_PKCSOpenStore;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SERIALIZED))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_SERIALIZED, -1))
openFunc = CRYPT_SerializedOpenStore;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION, -1))
openFunc = CRYPT_CollectionOpenStore;
- else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY))
+ else if (!_strnicmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY, -1))
openFunc = CRYPT_SysRegOpenStoreW;
else
{
More information about the wine-cvs
mailing list