- 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.

svn path=/trunk/; revision=36676
This commit is contained in:
Aleksey Bragin
2008-10-07 11:23:36 +00:00
parent 41e05c41dd
commit cab14c3ecc
2 changed files with 82 additions and 2 deletions
+79
View File
@@ -19,6 +19,7 @@
*/
#include "precomp.h"
#include "debug.h"
HINSTANCE hLibModule;
@@ -40,3 +41,81 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
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;
}
+3 -2
View File
@@ -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