Author: fireball Date: Tue Oct 7 06:23:36 2008 New Revision: 36676
URL: http://svn.reactos.org/svn/reactos?rev=36676&view=rev Log: Daniel Zimmerman netzimme@aim.com - Sync the sfc_os.dll with Wine and implement SfcIsFileProtected and SfcIsKeyProtected. The installer will work better with this two function.
See issue #3719 for more details.
Modified: trunk/reactos/dll/win32/sfc_os/sfc_os.c trunk/reactos/dll/win32/sfc_os/sfc_os.spec
Modified: trunk/reactos/dll/win32/sfc_os/sfc_os.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc_os/sfc_os.c?r... ============================================================================== --- trunk/reactos/dll/win32/sfc_os/sfc_os.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sfc_os/sfc_os.c [iso-8859-1] Tue Oct 7 06:23:36 2008 @@ -19,6 +19,7 @@ */
#include "precomp.h" +#include "debug.h"
HINSTANCE hLibModule;
@@ -40,3 +41,81 @@
return TRUE; } + + +/****************************************************************** + * SfcIsFileProtected [sfc_os.@] + * + * Check, if the given File is protected by the System + * + * PARAMS + * RpcHandle [I] This must be NULL + * ProtFileName [I] Filename with Path to check + * + * RETURNS + * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND + * Success: TRUE, when the File is Protected + * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND, + * when the File is not Protected + * + * + * BUGS + * We return always the Result for: "File is not Protected" + * + */ +BOOL WINAPI SfcIsFileProtected(HANDLE RpcHandle, LPCWSTR ProtFileName) +{ + static BOOL reported = FALSE; + + if (reported) { + DPRINT("(%p, %S) stub\n", RpcHandle, ProtFileName); + } + else + { + DPRINT1("(%p, %S) stub\n", RpcHandle, ProtFileName); + reported = TRUE; + } + + SetLastError(ERROR_FILE_NOT_FOUND); + return FALSE; +} + +/****************************************************************** + * SfcIsKeyProtected [sfc_os.@] + * + * Check, if the given Registry Key is protected by the System + * + * PARAMS + * hKey [I] Handle to the root registry key + * lpSubKey [I] Name of the subkey to check + * samDesired [I] The Registry View to Examine (32 or 64 bit) + * + * RETURNS + * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND + * Success: TRUE, when the Key is Protected + * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND, + * when the Key is not Protected + * + */ +BOOL WINAPI SfcIsKeyProtected(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired) +{ + static BOOL reported = FALSE; + + if (reported) { + DPRINT("(%p, %S) stub\n", hKey, lpSubKey); + } + else + { + DPRINT1("(%p, %S) stub\n", hKey, lpSubKey); + reported = TRUE; + } + + if( !hKey ) { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + SetLastError(ERROR_FILE_NOT_FOUND); + return FALSE; +} +
Modified: trunk/reactos/dll/win32/sfc_os/sfc_os.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc_os/sfc_os.spe... ============================================================================== --- trunk/reactos/dll/win32/sfc_os/sfc_os.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sfc_os/sfc_os.spec [iso-8859-1] Tue Oct 7 06:23:36 2008 @@ -6,6 +6,7 @@ @ stub sfc_os_6 @ stub sfc_os_7 @ stub SfcGetNextProtectedFile -@ stub SfcIsFileProtected +@ stdcall SfcIsFileProtected(ptr wstr) +@ stdcall SfcIsKeyProtected(long wstr long) @ stub SfcWLEventLogoff -@ stub SfcWLEventLogon +@ stub SfcWLEventLogon