From f326c554031f6b25b8360373d49ef0926b455f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 7 Jun 2006 17:24:49 +0000 Subject: [PATCH] - Implement FileEncryptionStatusA - Fix FileEncryptionStatusW prototype - Fix EncryptionDisable stub svn path=/trunk/; revision=22271 --- reactos/dll/win32/advapi32/crypt/crypt.c | 38 +++++++++++++++++------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/reactos/dll/win32/advapi32/crypt/crypt.c b/reactos/dll/win32/advapi32/crypt/crypt.c index 52a00a59517..fb53ceee497 100644 --- a/reactos/dll/win32/advapi32/crypt/crypt.c +++ b/reactos/dll/win32/advapi32/crypt/crypt.c @@ -1981,25 +1981,42 @@ DWORD WINAPI RemoveUsersFromEncryptedFile ( * @unimplemented */ BOOL WINAPI FileEncryptionStatusW ( - LPCWSTR lpcwstr, - LPDWORD lpdword + LPCWSTR lpFileName, + LPDWORD lpStatus ) { - DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + DPRINT1("%s(%S) not implemented!\n", __FUNCTION__, lpFileName); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } /* - * @unimplemented + * @implemented */ BOOL WINAPI FileEncryptionStatusA ( - LPCSTR lpcstr, - LPDWORD lpdword + LPCSTR lpFileName, + LPDWORD lpStatus ) { - DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + UNICODE_STRING FileName; + NTSTATUS Status; + BOOL ret = FALSE; + + FileName.Buffer = NULL; + + Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName); + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + goto cleanup; + } + ret = FileEncryptionStatusW(FileName.Buffer, lpStatus); + +cleanup: + if (FileName.Buffer != NULL) + RtlFreeUnicodeString(&FileName); + return ret; } /* @@ -2048,7 +2065,8 @@ BOOL WINAPI EncryptionDisable( ) { DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; }