Author: hpoussin
Date: Wed Jun 7 21:26:25 2006
New Revision: 22272
URL:
http://svn.reactos.ru/svn/reactos?rev=22272&view=rev
Log:
- Implement DecryptFileA
- Fix some stubs
- Remove dead code
Modified:
trunk/reactos/dll/win32/advapi32/sec/sec.c
trunk/reactos/dll/win32/advapi32/service/scm.c
Modified: trunk/reactos/dll/win32/advapi32/sec/sec.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/sec.…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/sec.c (original)
+++ trunk/reactos/dll/win32/advapi32/sec/sec.c Wed Jun 7 21:26:25 2006
@@ -527,35 +527,54 @@
*/
BOOL WINAPI DecryptFileW(LPCWSTR lpFileName, DWORD dwReserved)
{
+ DPRINT1("%s(%S) not implemented!\n", __FUNCTION__, lpFileName);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
+{
+ 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 = DecryptFileW(FileName.Buffer, dwReserved);
+
+cleanup:
+ if (FileName.Buffer != NULL)
+ RtlFreeUnicodeString(&FileName);
+ return ret;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI EncryptFileW(LPCWSTR lpFileName)
+{
DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
/*
* @unimplemented
*/
-BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
+BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
{
DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-/*
- * @unimplemented
- */
-BOOL WINAPI EncryptFileW(LPCWSTR lpFileName)
-{
- DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-/*
- * @unimplemented
- */
-BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
-{
- DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(
@@ -566,7 +585,8 @@
PULONG pulong)
{
DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA(
@@ -577,7 +597,8 @@
PULONG pulong)
{
DPRINT1("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
/* EOF */
Modified: trunk/reactos/dll/win32/advapi32/service/scm.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/advapi32/service/…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/scm.c (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c Wed Jun 7 21:26:25 2006
@@ -1374,7 +1374,7 @@
(unsigned int*)&hService);
if (dwError != ERROR_SUCCESS)
{
- DPRINT1("ScmrOpenServiceW() failed (Error %lu)\n", dwError);
+ DPRINT("ScmrOpenServiceW() failed (Error %lu)\n", dwError);
SetLastError(dwError);
return NULL;
}
@@ -1923,27 +1923,6 @@
DWORD dwNumServiceArgs,
LPCSTR *lpServiceArgVectors)
{
-#if 0
- DWORD dwError;
-
- DPRINT("StartServiceA()\n");
-
- HandleBind();
-
- /* Call to services.exe using RPC */
- dwError = ScmrStartServiceA(BindingHandle,
- hService,
- dwNumServiceArgs,
- lpServiceArgVectors);
- if (dwError != ERROR_SUCCESS)
- {
- DPRINT1("ScmrStartServiceA() failed (Error %lu)\n", dwError);
- SetLastError(dwError);
- return FALSE;
- }
-
- return TRUE;
-#endif
LPSTR lpBuffer;
LPSTR lpStr;
DWORD dwError;
@@ -2000,27 +1979,6 @@
DWORD dwNumServiceArgs,
LPCWSTR *lpServiceArgVectors)
{
-#if 0
- DWORD dwError;
-
- DPRINT("StartServiceW()\n");
-
- HandleBind();
-
- /* Call to services.exe using RPC */
- dwError = ScmrStartServiceW(BindingHandle,
- hService,
- dwNumServiceArgs,
- lpServiceArgVectors);
- if (dwError != ERROR_SUCCESS)
- {
- DPRINT1("ScmrStartServiceW() failed (Error %lu)\n", dwError);
- SetLastError(dwError);
- return FALSE;
- }
-
- return TRUE;
-#endif
LPWSTR lpBuffer;
LPWSTR lpStr;
DWORD dwError;