Stub RtlEncryptMemory/RtlDecryptMemory (040/041)

Mike Hearn mike at navi.cx
Fri Apr 16 16:19:25 CDT 2004


Mike Hearn <mike at navi.cx>
Documentation for these two internal functions has become available, so stub
them out in case applications use them.

Generated from:
* mike at navi.cx--2004/wine--mainline--0.9--patch-11
* mike at navi.cx--2004/wine--mainline--0.9--patch-12

--- orig/dlls/advapi32/advapi32.spec
+++ mod/dlls/advapi32/advapi32.spec
@@ -315,8 +315,8 @@
 @ stub SystemFunction034
 @ stub SystemFunction035
 @ stub SystemFunction036
-@ stub SystemFunction040
-@ stub SystemFunction041
+@ stdcall SystemFunction040(ptr long long) # RtlEncryptMemory
+@ stdcall SystemFunction041(ptr long long) # RtlDecryptMemory
 @ stub TraceEvent
 @ stub TraceEventInstance
 @ stub TraceMessage
--- mod/dlls/advapi32/crypt.c
+++ mod/dlls/advapi32/crypt.c
@@ -39,6 +39,8 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "wine/debug.h"
+#include "winternl.h"
+#include "ntstatus.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(crypt);
 
@@ -1346,0 +1349,38 @@
+
+
+/* these should probably forward to NTDLL, however there are no exports with these names
+   These functions have nearly identical prototypes to CryptProtectMemory and CryptUnprotectMemory,
+   in crypt32.dll and so they should probably forward to these functions as well.
+ */
+
+/******************************************************************************
+ * RtlEncryptMemory
+ *
+ * PARAMS:
+ *   memory : pointer to memory to encrypt
+ *   length : length of region to encrypt, in bytes. must be multiple of RTL_ENCRYPT_MEMORY_SIZE
+ *   flags  : RTL_ENCRYPT_OPTION_SAME_PROCESS | RTL_ENCRYPT_OPTION_CROSS_PROCESS, | RTL_ENCRYPT_OPTION_SAME_LOGON
+ *            control whether other processes are able to decrypt the memory. The same value must be given
+ *            when decrypting the memory.
+ */
+NTSTATUS WINAPI SystemFunction040(PVOID memory, ULONG length, ULONG flags)  /* RtlEncryptMemory */ 
+{
+	FIXME("(%p, %lx, %lx): stub [RtlEncryptMemory]\n", memory, length, flags);
+	return STATUS_SUCCESS;
+}
+
+/******************************************************************************
+ * RtlDecryptMemory
+ *
+ * PARAMS:
+ *   memory : pointer to memory to decrypt
+ *   length : length of region to decrypt, in bytes. must be multiple of RTL_ENCRYPT_MEMORY_SIZE
+ *   flags  : RTL_ENCRYPT_OPTION_SAME_PROCESS | RTL_ENCRYPT_OPTION_CROSS_PROCESS, | RTL_ENCRYPT_OPTION_SAME_LOGON
+ *            control whether other processes are able to decrypt the memory. The same value must be given
+ *            when encrypting the memory.
+ */
+NTSTATUS WINAPI SystemFunction041(PVOID memory, ULONG length, ULONG flags)  /* RtlDecryptMemory */
+{
+	FIXME("(%p, %lx, %lx): stub [RtlDecryptMemory]\n", memory, length, flags);
+	return STATUS_SUCCESS;	
+}




More information about the wine-patches mailing list