[KSECDD]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 28 Jan 2014 21:52:53 +0000 (21:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 28 Jan 2014 21:52:53 +0000 (21:52 +0000)
Add public ksecioctl.h containing the supported IOCTLs

svn path=/trunk/; revision=61871

reactos/drivers/crypto/ksecdd/CMakeLists.txt
reactos/drivers/crypto/ksecdd/dispatch.c
reactos/drivers/crypto/ksecdd/ksecdd.h
reactos/include/reactos/drivers/ksecdd/ksecioctl.h [new file with mode: 0644]

index eb8a318..1ffccb4 100644 (file)
@@ -3,6 +3,7 @@ spec2def(ksecdd.sys ksecdd.spec)
 
 
 include_directories(
+    ${REACTOS_SOURCE_DIR}/include/reactos/drivers/ksecdd
     ${REACTOS_SOURCE_DIR}/lib/cryptlib)
 
 list(APPEND SOURCE
index 34be2fb..9209bc2 100644 (file)
@@ -9,6 +9,7 @@
 /* INCLUDES *******************************************************************/
 
 #include "ksecdd.h"
+#include <ksecioctl.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -96,7 +97,12 @@ KsecDeviceControl(
     /* Check ioctl code */
     switch (IoControlCode)
     {
-        case IOCTL_KSEC_GEN_RANDOM:
+        case IOCTL_KSEC_REGISTER_LSA_PROCESS:
+
+            Status = STATUS_SUCCESS;
+            break;
+
+        case IOCTL_KSEC_RANDOM_FILL_BUFFER:
 
             Status = KsecGenRandom(Buffer, *OutputLength);
             break;
index 86eebb4..addcd15 100644 (file)
 #include <ntifs.h>
 #include <ndk/extypes.h>
 
-// 0x390004
-#define IOCTL_KSEC_GEN_RANDOM \
-    CTL_CODE(FILE_DEVICE_KSEC, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
 #if defined(_M_IX86) || defined(_M_AMD64)
 typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS
 {
diff --git a/reactos/include/reactos/drivers/ksecdd/ksecioctl.h b/reactos/include/reactos/drivers/ksecdd/ksecioctl.h
new file mode 100644 (file)
index 0000000..004db5a
--- /dev/null
@@ -0,0 +1,43 @@
+
+
+#pragma once
+
+// 0: 0x398000 - called from LSASRV!LsapInitLsa
+#define IOCTL_KSEC_REGISTER_LSA_PROCESS \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x00, METHOD_BUFFERED, FILE_WRITE_ACCESS)
+
+// 1: 0x390004 - called from tcpip!InitIsnGenerator
+#define IOCTL_KSEC_1 \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// 2: 0x390008 - called from SystemFunction036 aka RtlGenRandom via RandomFillBuffer
+#define IOCTL_KSEC_RANDOM_FILL_BUFFER \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// 3: 0x39000E - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 0
+#define IOCTL_KSEC_ENCRYPT_PROCESS \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x03, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// 4: 0x390012 - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 0
+#define IOCTL_KSEC_DECRYPT_PROCESS \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x04, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// 5: 0x390016 - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 1
+#define IOCTL_KSEC_ENCRYPT_CROSS_PROCESS \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x05, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// 6: 0x39001A - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 1
+#define IOCTL_KSEC_DECRYPT_CROSS_PROCESS \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x06, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// 7: 0x39001E - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 2
+#define IOCTL_KSEC_ENCRYPT_SAME_LOGON \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x07, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// 8: 0x390022 - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 2
+#define IOCTL_KSEC_DECRYPT_SAME_LOGON \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x08, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+
+// e: 0x390038 - see http://wiki.mysmartlogon.com/Kernel_mode_SSP
+#define IOCTL_KSEC_REGISTER_EXTENSION \
+    CTL_CODE(FILE_DEVICE_KSEC, 0x0e, METHOD_BUFFERED, FILE_ANY_ACCESS)