Author: akhaldi
Date: Sat Nov 28 21:21:52 2015
New Revision: 70195
URL:
http://svn.reactos.org/svn/reactos?rev=70195&view=rev
Log:
[ADVAPI32] Sync crypt.c with Wine Staging 1.7.55 and update the exports list accordingly.
CORE-10536
Modified:
trunk/reactos/dll/win32/advapi32/advapi32.spec
trunk/reactos/dll/win32/advapi32/wine/crypt.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Sat Nov 28 21:21:52 2015
@@ -59,7 +59,7 @@
59 stdcall ClearEventLogA(long str)
60 stdcall ClearEventLogW(long wstr)
61 stub CloseCodeAuthzLevel
-62 stub CloseEncryptedFileRaw
+62 stdcall CloseEncryptedFileRaw(ptr)
63 stdcall CloseEventLog(long)
64 stdcall CloseServiceHandle(long)
65 stub CloseTrace
Modified: trunk/reactos/dll/win32/advapi32/wine/crypt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/wine/cr…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/wine/crypt.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/wine/crypt.c [iso-8859-1] Sat Nov 28 21:21:52 2015
@@ -294,6 +294,23 @@
}
}
+
+/******************************************************************************
+ * CloseEncryptedFileRaw (ADVAPI32.@)
+ *
+ * Close encrypted files
+ *
+ * PARAMS
+ * context [I] pointer to the context
+ * RETURNS
+ * Success: ERROR_SUCCESS
+ * Failure: NTSTATUS error code
+ */
+void WINAPI CloseEncryptedFileRaw(PVOID context)
+{
+ FIXME("(%p): stub\n", context);
+}
+
/******************************************************************************
* CryptAcquireContextW (ADVAPI32.@)
*
@@ -306,7 +323,7 @@
* dwProvType [I] Crypto provider type to get a handle.
* dwFlags [I] flags for the operation
*
- * RETURNS
+ * RETURNS
* TRUE on success, FALSE on failure.
*/
BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
@@ -330,7 +347,7 @@
SetLastError(NTE_BAD_PROV_TYPE);
return FALSE;
}
-
+
if (!phProv)
{
SetLastError(ERROR_INVALID_PARAMETER);
@@ -566,7 +583,7 @@
*/
BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFlags)
{
- PCRYPTPROV pProv = (PCRYPTPROV)hProv;
+ PCRYPTPROV pProv = (PCRYPTPROV)hProv;
TRACE("(0x%lx, %p, %08x)\n", hProv, pdwReserved, dwFlags);
@@ -619,7 +636,7 @@
}
pProv->refcount--;
- if (pProv->refcount <= 0)
+ if (pProv->refcount <= 0)
{
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
pProv->dwMagic = 0;
@@ -1127,10 +1144,10 @@
{
DWORD numkeys;
WCHAR *provNameW;
-
+
RegQueryInfoKeyW(hKey, NULL, NULL, NULL, &numkeys, pcbProvName,
NULL, NULL, NULL, NULL, NULL, NULL);
-
+
if (!(provNameW = CRYPT_Alloc(*pcbProvName * sizeof(WCHAR))))
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@@ -1152,7 +1169,7 @@
DWORD size = sizeof(DWORD);
DWORD result;
HKEY subkey;
-
+
result = RegEnumKeyW(hKey, dwIndex, pszProvName, *pcbProvName / sizeof(WCHAR));
if (result)
{
@@ -1296,7 +1313,7 @@
*pdwProvType += (*(--ch) - '0') * 10;
*pdwProvType += (*(--ch) - '0') * 100;
CRYPT_Free(keyname);
-
+
result = RegQueryValueExW(hSubkey, typenameW, NULL, &dwType, (LPBYTE)pszTypeName,
pcbTypeName);
if (result)
{
@@ -1349,7 +1366,7 @@
/******************************************************************************
* CryptExportKey (ADVAPI32.@)
- *
+ *
* Exports a cryptographic key from a CSP.
*
* PARAMS
@@ -1490,8 +1507,8 @@
return FALSE;
}
CRYPT_Free(keyname);
-
- result = RegQueryValueExW(hKey, nameW, NULL, NULL, (LPBYTE)pszProvName, pcbProvName);
+
+ result = RegQueryValueExW(hKey, nameW, NULL, NULL, (LPBYTE)pszProvName, pcbProvName);
RegCloseKey(hKey);
if (result)
@@ -1500,10 +1517,10 @@
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
else
SetLastError(result);
-
- return FALSE;
- }
-
+
+ return FALSE;
+ }
+
return TRUE;
}
@@ -1751,7 +1768,7 @@
*
* Compute the cryptographic hash of a session key object.
*
- * PARAMS
+ * PARAMS
* hHash [I] Handle to the hash object.
* hKey [I] Handle to the key to be hashed.
* dwFlags [I] Can be CRYPT_LITTLE_ENDIAN.
@@ -1866,7 +1883,7 @@
PCRYPTHASH hash = (PCRYPTHASH)hHash;
PCRYPTPROV prov;
- TRACE("(0x%lx, %d, %s, %08x, %p, %p)\n",
+ TRACE("(0x%lx, %d, %s, %08x, %p, %p)\n",
hHash, dwKeySpec, debugstr_w(sDescription), dwFlags, pbSignature, pdwSigLen);
if (!hash)
@@ -1897,7 +1914,7 @@
LPWSTR wsDescription;
BOOL result;
- TRACE("(0x%lx, %d, %s, %08x, %p, %p)\n",
+ TRACE("(0x%lx, %d, %s, %08x, %p, %p)\n",
hHash, dwKeySpec, debugstr_a(sDescription), dwFlags, pbSignature, pdwSigLen);
CRYPT_ANSIToUnicode(sDescription, &wsDescription, -1);
@@ -2058,7 +2075,7 @@
return FALSE;
}
CRYPT_Free(keyname);
-
+
if (dwFlags & CRYPT_DELETE_DEFAULT)
{
RegDeleteValueW(hTypeKey, nameW);
@@ -2080,7 +2097,7 @@
return FALSE;
}
CRYPT_Free(keyname);
-
+
if (RegSetValueExW(hTypeKey, nameW, 0, REG_SZ, (const BYTE *)pszProvName,
(strlenW(pszProvName) + 1)*sizeof(WCHAR)))
{
@@ -2088,7 +2105,7 @@
RegCloseKey(hProvKey);
return FALSE;
}
-
+
RegCloseKey(hProvKey);
}
RegCloseKey(hTypeKey);
@@ -2184,7 +2201,7 @@
* RETURNS
* Success: TRUE
* Failure: FALSE
- *
+ *
* NOTES
* Because of security flaws sDescription should not be used and should thus be
* NULL. It is supported only for compatibility with Microsoft's Cryptographic
@@ -2207,7 +2224,7 @@
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
-
+
prov = hash->pProvider;
return prov->pFuncs->pCPVerifySignature(prov->hPrivate, hash->hPrivate,
pbSignature, dwSigLen,
key->hPrivate, sDescription, dwFlags);
@@ -2288,7 +2305,8 @@
dev_random = open("/dev/urandom", O_RDONLY);
if (dev_random != -1)
{
- if (read(dev_random, pbBuffer, dwLen) == (ssize_t)dwLen)
+ if (!IsBadWritePtr( pbBuffer, dwLen ) &&
+ read(dev_random, pbBuffer, dwLen) == (ssize_t)dwLen)
{
close(dev_random);
return TRUE;
@@ -2299,8 +2317,8 @@
FIXME("couldn't open /dev/urandom\n");
SetLastError(NTE_FAIL);
return FALSE;
-}
-
+}
+
/*
These functions have nearly identical prototypes to CryptProtectMemory and
CryptUnprotectMemory,
in crypt32.dll.
@@ -2315,10 +2333,10 @@
* memory [I/O] Pointer to memory to encrypt.
* length [I] Length of region to encrypt in bytes.
* flags [I] Control whether other processes are able to decrypt the memory.
- * RTL_ENCRYPT_OPTION_SAME_PROCESS
- * RTL_ENCRYPT_OPTION_CROSS_PROCESS
+ * RTL_ENCRYPT_OPTION_SAME_PROCESS
+ * RTL_ENCRYPT_OPTION_CROSS_PROCESS
* RTL_ENCRYPT_OPTION_SAME_LOGON
- *
+ *
* RETURNS
* Success: STATUS_SUCCESS
* Failure: NTSTATUS error code
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Nov 28 21:21:52 2015
@@ -257,7 +257,7 @@
advapi32 -
reactos/dll/win32/advapi32/wine/cred.c # Synced to WineStaging-1.7.37
- reactos/dll/win32/advapi32/wine/crypt.c # Synced to Wine-1.7.27
+ reactos/dll/win32/advapi32/wine/crypt.c # Synced to WineStaging-1.7.55
reactos/dll/win32/advapi32/wine/crypt_des.c # Synced to WineStaging-1.7.37
reactos/dll/win32/advapi32/wine/crypt_lmhash.c # Synced to WineStaging-1.7.37
reactos/dll/win32/advapi32/wine/security.c # Out of Sync