[MSI]
[reactos.git] / reactos / dll / win32 / advapi32 / misc / efs.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: dlls/win32/advapi32/misc/efs.c
5 * PURPOSE: Encrypted File System support
6 * PROGRAMMER: Christoph_vW
7 */
8
9 #include <advapi32.h>
10 #include "wine/debug.h"
11
12 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
13
14
15 /*
16 * @unimplemented
17 */
18 DWORD WINAPI
19 AddUsersToEncryptedFile(LPCWSTR lpcwstr,
20 PENCRYPTION_CERTIFICATE_LIST pencryption_certificate_list)
21 {
22 FIXME("%s() not implemented!\n", __FUNCTION__);
23 return ERROR_CALL_NOT_IMPLEMENTED;
24 }
25
26
27 /*
28 * @implemented
29 */
30 BOOL WINAPI
31 DecryptFileA(LPCSTR lpFileName,
32 DWORD dwReserved)
33 {
34 UNICODE_STRING FileName;
35 NTSTATUS Status;
36 BOOL ret;
37
38 Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
39 if (!NT_SUCCESS(Status))
40 {
41 SetLastError(RtlNtStatusToDosError(Status));
42 return FALSE;
43 }
44
45 ret = DecryptFileW(FileName.Buffer, dwReserved);
46
47 if (FileName.Buffer != NULL)
48 RtlFreeUnicodeString(&FileName);
49 return ret;
50 }
51
52
53 /*
54 * @unimplemented
55 */
56 BOOL WINAPI
57 DecryptFileW(LPCWSTR lpFileName,
58 DWORD dwReserved)
59 {
60 FIXME("%s(%S) not implemented!\n", __FUNCTION__, lpFileName);
61 return TRUE;
62 }
63
64
65 /*
66 * @implemented
67 */
68 BOOL WINAPI
69 EncryptFileA(LPCSTR lpFileName)
70 {
71 UNICODE_STRING FileName;
72 NTSTATUS Status;
73 BOOL ret;
74
75 Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
76 if (!NT_SUCCESS(Status))
77 {
78 SetLastError(RtlNtStatusToDosError(Status));
79 return FALSE;
80 }
81
82 ret = EncryptFileW(FileName.Buffer);
83
84 if (FileName.Buffer != NULL)
85 RtlFreeUnicodeString(&FileName);
86 return ret;
87 }
88
89
90 /*
91 * @unimplemented
92 */
93 BOOL WINAPI
94 EncryptFileW(LPCWSTR lpFileName)
95 {
96 FIXME("%s() not implemented!\n", __FUNCTION__);
97 return TRUE;
98 }
99
100
101 /*
102 * @unimplemented
103 */
104 BOOL WINAPI
105 EncryptionDisable(LPCWSTR DirPath,
106 BOOL Disable)
107 {
108 FIXME("%s() not implemented!\n", __FUNCTION__);
109 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
110 return FALSE;
111 }
112
113
114 /*
115 * @implemented
116 */
117 BOOL WINAPI
118 FileEncryptionStatusA(LPCSTR lpFileName,
119 LPDWORD lpStatus)
120 {
121 UNICODE_STRING FileName;
122 NTSTATUS Status;
123 BOOL ret = FALSE;
124
125 TRACE("(%s, %p)\n", lpFileName, lpStatus);
126
127 FileName.Buffer = NULL;
128
129 Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
130 if (!NT_SUCCESS(Status))
131 {
132 SetLastError(RtlNtStatusToDosError(Status));
133 goto cleanup;
134 }
135
136 ret = FileEncryptionStatusW(FileName.Buffer, lpStatus);
137
138 cleanup:
139 if (FileName.Buffer != NULL)
140 RtlFreeUnicodeString(&FileName);
141
142 return ret;
143 }
144
145 /*
146 * @unimplemented
147 */
148 BOOL WINAPI
149 FileEncryptionStatusW(LPCWSTR lpFileName,
150 LPDWORD lpStatus)
151 {
152 FIXME("%s(%S) not implemented!\n", __FUNCTION__, lpFileName);
153
154 if (!lpStatus)
155 return FALSE;
156
157 *lpStatus = FILE_SYSTEM_NOT_SUPPORT;
158
159 return TRUE;
160 }
161
162
163 /*
164 * @unimplemented
165 */
166 VOID WINAPI
167 FreeEncryptionCertificateHashList(PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list)
168 {
169 FIXME("%s() not implemented!\n", __FUNCTION__);
170 return;
171 }
172
173
174 /*
175 * @unimplemented
176 */
177 DWORD WINAPI
178 QueryRecoveryAgentsOnEncryptedFile(LPCWSTR lpctstr,
179 PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list)
180 {
181 FIXME("%s() not implemented!\n", __FUNCTION__);
182 return ERROR_CALL_NOT_IMPLEMENTED;
183 }
184
185
186 /*
187 * @unimplemented
188 */
189 DWORD WINAPI
190 QueryUsersOnEncryptedFile(LPCWSTR lpctstr,
191 PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list)
192 {
193 FIXME("%s() not implemented!\n", __FUNCTION__);
194 return ERROR_CALL_NOT_IMPLEMENTED;
195 }
196
197
198 /*
199 * @unimplemented
200 */
201 DWORD WINAPI
202 RemoveUsersFromEncryptedFile(LPCWSTR lpcwstr,
203 PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list)
204 {
205 FIXME("%s() not implemented!\n", __FUNCTION__);
206 return ERROR_CALL_NOT_IMPLEMENTED;
207 }
208
209 /* EOF */