[ADVAPI32_APITEST]
[reactos.git] / reactos / drivers / crypto / ksecdd / ksecdd.h
1 /*
2 * PROJECT: ReactOS Drivers
3 * COPYRIGHT: See COPYING in the top level directory
4 * PURPOSE: Kernel Security Support Provider Interface Driver
5 *
6 * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9 #define _NO_KSECDD_IMPORT_
10 #include <ntifs.h>
11 #include <ndk/extypes.h>
12 #include <ndk/rtlfuncs.h>
13 #include <ndk/lpcfuncs.h>
14 #include <ndk/obfuncs.h>
15 #include <ntstrsafe.h>
16
17 #define STATUS_KSEC_INTERNAL_ERROR ((NTSTATUS)0x80090304)
18
19 /* FIXME: this should be in some shared header */
20 #define RTL_ENCRYPT_OPTION_SAME_PROCESS 0
21 #define RTL_ENCRYPT_OPTION_CROSS_PROCESS 1
22 #define RTL_ENCRYPT_OPTION_SAME_LOGON 2
23
24 typedef struct _KSEC_CONNECTION_INFO
25 {
26 ULONG Unknown0;
27 NTSTATUS Status;
28 ULONG_PTR Information;
29 CHAR ConnectionString[128];
30 ULONG Flags;
31 } KSEC_CONNECTION_INFO;
32
33 #if defined(_M_IX86) || defined(_M_AMD64)
34 typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS
35 {
36 ULONG64 Tsc;
37 ULONG64 Pmc0;
38 ULONG64 Pmc1;
39 ULONG64 Ctr0;
40 ULONG64 Ctr1;
41 } KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS;
42 #else
43 typedef ULONG KSEC_MACHINE_SPECIFIC_COUNTERS;
44 #endif
45
46 typedef struct _KSEC_ENTROPY_DATA
47 {
48 HANDLE CurrentProcessId;
49 HANDLE CurrentThreadId;
50 LARGE_INTEGER TickCount;
51 LARGE_INTEGER SystemTime;
52 LARGE_INTEGER PerformanceCounter;
53 LARGE_INTEGER PerformanceFrequency;
54 UCHAR EnvironmentHash[16];
55 KSEC_MACHINE_SPECIFIC_COUNTERS MachineSpecificCounters;
56 SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorPerformanceInformation;
57 SYSTEM_PERFORMANCE_INFORMATION SystemPerformanceInformation;
58 SYSTEM_EXCEPTION_INFORMATION SystemExceptionInformation;
59 SYSTEM_LOOKASIDE_INFORMATION SystemLookasideInformation;
60 SYSTEM_INTERRUPT_INFORMATION SystemInterruptInformation;
61 SYSTEM_PROCESS_INFORMATION SystemProcessInformation;
62 } KSEC_ENTROPY_DATA, *PKSEC_ENTROPY_DATA;
63
64 extern PEPROCESS KsecLsaProcess;;
65 extern HANDLE KsecLsaProcessHandle;
66
67 NTSTATUS
68 NTAPI
69 KsecDdDispatch(
70 PDEVICE_OBJECT DeviceObject,
71 PIRP Irp);
72
73
74 NTSTATUS
75 NTAPI
76 KsecGenRandom(
77 PVOID Buffer,
78 SIZE_T Length);
79
80 NTSTATUS
81 NTAPI
82 KsecEncryptMemory (
83 _Inout_ PVOID Buffer,
84 _In_ ULONG Length,
85 _In_ ULONG OptionFlags);
86
87 NTSTATUS
88 NTAPI
89 KsecDecryptMemory (
90 _Inout_ PVOID Buffer,
91 _In_ ULONG Length,
92 _In_ ULONG OptionFlags);
93
94 NTSTATUS
95 NTAPI
96 KsecInitLsaMemory(VOID);
97
98 ///
99 PVOID
100 NTAPI
101 PsGetProcessSecurityPort(
102 PEPROCESS Process);
103
104 NTSTATUS
105 NTAPI
106 PsSetProcessSecurityPort(
107 PEPROCESS Process,
108 PVOID SecurityPort);
109
110 HANDLE
111 NTAPI
112 PsGetCurrentThreadProcessId(VOID);
113