[ros-diffs] [weiden] 27713: Implement the ANSI stub EncryptFileA

weiden at svn.reactos.org weiden at svn.reactos.org
Wed Jul 18 12:40:59 CEST 2007


Author: weiden
Date: Wed Jul 18 14:40:58 2007
New Revision: 27713

URL: http://svn.reactos.org/svn/reactos?rev=27713&view=rev
Log:
Implement the ANSI stub EncryptFileA

Modified:
    trunk/reactos/dll/win32/advapi32/sec/sec.c

Modified: trunk/reactos/dll/win32/advapi32/sec/sec.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/sec.c?rev=27713&r1=27712&r2=27713&view=diff
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/sec.c (original)
+++ trunk/reactos/dll/win32/advapi32/sec/sec.c Wed Jul 18 14:40:58 2007
@@ -561,19 +561,17 @@
 {
     UNICODE_STRING FileName;
     NTSTATUS Status;
-    BOOL ret = FALSE;
-
-    FileName.Buffer = NULL;
+    BOOL ret;
 
     Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
     if (!NT_SUCCESS(Status))
     {
         SetLastError(RtlNtStatusToDosError(Status));
-        goto cleanup;
+        return FALSE;
     }
+
     ret = DecryptFileW(FileName.Buffer, dwReserved);
 
-cleanup:
     if (FileName.Buffer != NULL)
         RtlFreeUnicodeString(&FileName);
     return ret;
@@ -590,13 +588,26 @@
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
 {
-    DPRINT1("%s() not implemented!\n", __FUNCTION__);
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return FALSE;
+    UNICODE_STRING FileName;
+    NTSTATUS Status;
+    BOOL ret;
+
+    Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
+    if (!NT_SUCCESS(Status))
+    {
+        SetLastError(RtlNtStatusToDosError(Status));
+        return FALSE;
+    }
+
+    ret = EncryptFileW(FileName.Buffer);
+
+    if (FileName.Buffer != NULL)
+        RtlFreeUnicodeString(&FileName);
+    return ret;
 }
 
 BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(




More information about the Ros-diffs mailing list