https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4a89f6ccaf19953acf0d218e9e0f985c5d6004b

commit d4a89f6ccaf19953acf0d218e9e0f985c5d6004b
Author:     Amine Khaldi <[email protected]>
AuthorDate: Sun Apr 1 13:17:00 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Apr 1 13:17:00 2018 +0100

    [ADVAPI32] Sync crypt.c with Wine Staging 3.3. CORE-14434
---
 dll/win32/advapi32/advapi32.spec |  6 +--
 dll/win32/advapi32/wine/crypt.c  | 86 +++++++++++++++++++++++++++++++++++++++-
 media/doc/README.WINE            |  2 +-
 3 files changed, 88 insertions(+), 6 deletions(-)

diff --git a/dll/win32/advapi32/advapi32.spec b/dll/win32/advapi32/advapi32.spec
index 19193f0d25..d30aa734fb 100644
--- a/dll/win32/advapi32/advapi32.spec
+++ b/dll/win32/advapi32/advapi32.spec
@@ -422,8 +422,8 @@
 422 stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long)
 423 stdcall OpenBackupEventLogA(str str)
 424 stdcall OpenBackupEventLogW(wstr wstr)
-425 stub OpenEncryptedFileRawA
-426 stub OpenEncryptedFileRawW
+425 stdcall OpenEncryptedFileRawA(str long ptr)
+426 stdcall OpenEncryptedFileRawW(wstr long ptr)
 427 stdcall OpenEventLogA(str str)
 428 stdcall OpenEventLogW(wstr wstr)
 429 stdcall OpenProcessToken(long long ptr)
@@ -454,7 +454,7 @@
 454 stdcall QueryTraceA(double str ptr) ntdll.EtwQueryTraceA
 455 stdcall QueryTraceW(double str ptr) ntdll.EtwQueryTraceA
 456 stdcall QueryUsersOnEncryptedFile(wstr ptr)
-457 stub ReadEncryptedFileRaw
+457 stdcall ReadEncryptedFileRaw(ptr ptr ptr)
 458 stdcall ReadEventLogA(long long long ptr long ptr ptr)
 459 stdcall ReadEventLogW(long long long ptr long ptr ptr)
 460 stdcall RegCloseKey(long)
diff --git a/dll/win32/advapi32/wine/crypt.c b/dll/win32/advapi32/wine/crypt.c
index ec4f8b01da..25cf65e837 100644
--- a/dll/win32/advapi32/wine/crypt.c
+++ b/dll/win32/advapi32/wine/crypt.c
@@ -22,9 +22,38 @@
  *  TODO:
  *  - Reference counting
  *  - Thread-safing
-  */
+ */
 
+#ifdef __REACTOS__
 #include <advapi32.h>
+#else
+#include "config.h"
+#include "wine/port.h"
+
+#include <limits.h>
+#include <time.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "crypt.h"
+#include "winnls.h"
+#include "winreg.h"
+#include "rpc.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "winternl.h"
+#endif /* __REACTOS__ */
+
 WINE_DEFAULT_DEBUG_CHANNEL(crypt);
 
 static HWND crypt_hWindow;
@@ -616,7 +645,11 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD 
*pdwReserved, DWORD dwFl
  *  Success: TRUE
  *  Failure: FALSE
  */
+#ifdef __REACTOS__
 BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
+#else
+BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, ULONG_PTR dwFlags)
+#endif
 {
        PCRYPTPROV pProv = (PCRYPTPROV)hProv;
        BOOL ret = TRUE;
@@ -2251,6 +2284,55 @@ BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, 
const BYTE *pbSignature, DW
        return result;
 }
 
+/******************************************************************************
+ * OpenEncryptedFileRawA   (ADVAPI32.@)
+ *
+ * See OpenEncryptedFileRawW
+ */
+DWORD WINAPI OpenEncryptedFileRawA(LPCSTR filename, ULONG flags, PVOID 
*context)
+{
+    FIXME("(%s, %x, %p): stub\n", debugstr_a(filename), flags, context);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/******************************************************************************
+ * OpenEncryptedFileRawW   (ADVAPI32.@)
+ *
+ * Opens an EFS encrypted file for backup/restore
+ *
+ * PARAMS
+ *  filename   [I] Filename to operate on
+ *  flags     [I] Operation to perform
+ *  context    [I] Handle to the context (out)
+ * RETURNS
+ *  Success: ERROR_SUCCESS
+ *  Failure: NTSTATUS error code
+ */
+DWORD WINAPI OpenEncryptedFileRawW(LPCWSTR filename, ULONG flags, PVOID 
*context)
+{
+    FIXME("(%s, %x, %p): stub\n", debugstr_w(filename), flags, context);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/******************************************************************************
+ * ReadEncryptedFileRaw   (ADVAPI32.@)
+ *
+ * Export encrypted files
+ *
+ * PARAMS
+ *  export   [I] pointer to the export callback function
+ *  callback     [I] pointer to the application defined context
+ *  context    [I] pointer to the system context
+ * RETURNS
+ *  Success: ERROR_SUCCESS
+ *  Failure: NTSTATUS error code
+ */
+DWORD WINAPI ReadEncryptedFileRaw(PFE_EXPORT_FUNC export, PVOID callback, 
PVOID context)
+{
+    FIXME("(%p, %p, %p): stub\n", export, callback, context);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
 #ifndef __REACTOS__
 /******************************************************************************
  * SystemFunction030   (ADVAPI32.@)
@@ -2290,7 +2372,7 @@ BOOL WINAPI SystemFunction035(LPCSTR lpszDllFilePath)
  * MSDN documents this function as RtlGenRandom and declares it in ntsecapi.h
  *
  * PARAMS
- *  pbBufer [O] Pointer to memory to receive random bytes.
+ *  pbBuffer [O] Pointer to memory to receive random bytes.
  *  dwLen   [I] Number of random bytes to fetch.
  *
  * RETURNS
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index e13a4a8f6b..ec73f7df22 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -258,7 +258,7 @@ reactos/sdk/lib/rtl/wait.c                  # Partly synced 
with WineStaging-1.7
 
 advapi32 -
   reactos/dll/win32/advapi32/wine/cred.c         # Synced to WineStaging-3.3
-  reactos/dll/win32/advapi32/wine/crypt.c        # Synced to WineStaging-1.7.55
+  reactos/dll/win32/advapi32/wine/crypt.c        # Synced to WineStaging-3.3
   reactos/dll/win32/advapi32/wine/crypt_des.c    # Synced to WineStaging-1.7.55
   reactos/dll/win32/advapi32/wine/crypt_lmhash.c # Synced to WineStaging-1.7.55
   reactos/dll/win32/advapi32/wine/security.c     # Out of Sync

Reply via email to