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