2007-01-16 20:35:06 +01:00
|
|
|
/*
|
|
|
|
* Implementation of the System File Checker (Windows File Protection)
|
|
|
|
*
|
|
|
|
* Copyright 2006 Detlef Riekenberg
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winerror.h"
|
2007-01-24 15:42:10 +01:00
|
|
|
#include "winreg.h"
|
2007-01-16 20:35:06 +01:00
|
|
|
#include "sfc.h"
|
2016-04-02 01:36:45 +02:00
|
|
|
#include "srrestoreptapi.h"
|
2007-01-16 20:35:06 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(sfc);
|
|
|
|
|
2015-10-27 06:12:04 +01:00
|
|
|
/******************************************************************
|
|
|
|
* SfcGetNextProtectedFile [sfc_os.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SfcGetNextProtectedFile(HANDLE handle, PROTECTED_FILE_DATA *data)
|
|
|
|
{
|
|
|
|
FIXME("%p %p\n", handle, data);
|
2018-03-04 17:51:25 +01:00
|
|
|
|
|
|
|
SetLastError(ERROR_NO_MORE_FILES);
|
2015-10-27 06:12:04 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-01-16 20:35:06 +01:00
|
|
|
/******************************************************************
|
|
|
|
* 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) {
|
|
|
|
TRACE("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
|
|
|
|
reported = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetLastError(ERROR_FILE_NOT_FOUND);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-06-01 22:10:02 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* 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) {
|
|
|
|
TRACE("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
|
|
|
|
reported = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !hKey ) {
|
|
|
|
SetLastError(ERROR_INVALID_HANDLE);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetLastError(ERROR_FILE_NOT_FOUND);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2016-03-28 09:54:12 +02:00
|
|
|
|
|
|
|
DWORD WINAPI SfcConnectToServer(DWORD unknown)
|
|
|
|
{
|
|
|
|
FIXME("%x\n", unknown);
|
|
|
|
return 0;
|
|
|
|
}
|
2016-04-02 01:36:45 +02:00
|
|
|
|
|
|
|
BOOL WINAPI SRSetRestorePointA(RESTOREPOINTINFOA *restorepoint, STATEMGRSTATUS *status)
|
|
|
|
{
|
|
|
|
FIXME("%p %p\n", restorepoint, status);
|
2016-04-13 05:12:16 +02:00
|
|
|
status->nStatus = ERROR_SUCCESS;
|
2016-04-02 01:36:45 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI SRSetRestorePointW(RESTOREPOINTINFOW *restorepoint, STATEMGRSTATUS *status)
|
|
|
|
{
|
|
|
|
FIXME("%p %p\n", restorepoint, status);
|
2016-04-13 05:12:16 +02:00
|
|
|
status->nStatus = ERROR_SUCCESS;
|
2016-04-02 01:36:45 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|