powrprof: Stub PowerSetActiveScheme.
[wine.git] / dlls / sfc_os / sfc_os.c
blobf4515f200902ee6e7ac18ed198e0b157abe5e366
1 /*
2 * Implementation of the System File Checker (Windows File Protection)
4 * Copyright 2006 Detlef Riekenberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "winreg.h"
27 #include "sfc.h"
28 #include "srrestoreptapi.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(sfc);
33 /******************************************************************
34 * DllMain
36 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
38 TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
40 switch(fdwReason)
42 case DLL_WINE_PREATTACH:
43 return FALSE; /* prefer native version */
45 case DLL_PROCESS_ATTACH:
46 DisableThreadLibraryCalls( hinstDLL );
47 break;
49 return TRUE;
52 /******************************************************************
53 * SfcGetNextProtectedFile [sfc_os.@]
55 BOOL WINAPI SfcGetNextProtectedFile(HANDLE handle, PROTECTED_FILE_DATA *data)
57 FIXME("%p %p\n", handle, data);
58 return FALSE;
61 /******************************************************************
62 * SfcIsFileProtected [sfc_os.@]
64 * Check, if the given File is protected by the System
66 * PARAMS
67 * RpcHandle [I] This must be NULL
68 * ProtFileName [I] Filename with Path to check
70 * RETURNS
71 * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND
72 * Success: TRUE, when the File is Protected
73 * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND,
74 * when the File is not Protected
77 * BUGS
78 * We return always the Result for: "File is not Protected"
81 BOOL WINAPI SfcIsFileProtected(HANDLE RpcHandle, LPCWSTR ProtFileName)
83 static BOOL reported = FALSE;
85 if (reported) {
86 TRACE("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
88 else
90 FIXME("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
91 reported = TRUE;
94 SetLastError(ERROR_FILE_NOT_FOUND);
95 return FALSE;
98 /******************************************************************
99 * SfcIsKeyProtected [sfc_os.@]
101 * Check, if the given Registry Key is protected by the System
103 * PARAMS
104 * hKey [I] Handle to the root registry key
105 * lpSubKey [I] Name of the subkey to check
106 * samDesired [I] The Registry View to Examine (32 or 64 bit)
108 * RETURNS
109 * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND
110 * Success: TRUE, when the Key is Protected
111 * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND,
112 * when the Key is not Protected
115 BOOL WINAPI SfcIsKeyProtected(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired)
117 static BOOL reported = FALSE;
119 if (reported) {
120 TRACE("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
122 else
124 FIXME("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
125 reported = TRUE;
128 if( !hKey ) {
129 SetLastError(ERROR_INVALID_HANDLE);
130 return FALSE;
133 SetLastError(ERROR_FILE_NOT_FOUND);
134 return FALSE;
137 DWORD WINAPI SfcConnectToServer(DWORD unknown)
139 FIXME("%x\n", unknown);
140 return 0;
143 BOOL WINAPI SRSetRestorePointA(RESTOREPOINTINFOA *restorepoint, STATEMGRSTATUS *status)
145 FIXME("%p %p\n", restorepoint, status);
146 status->nStatus = ERROR_SUCCESS;
147 return FALSE;
150 BOOL WINAPI SRSetRestorePointW(RESTOREPOINTINFOW *restorepoint, STATEMGRSTATUS *status)
152 FIXME("%p %p\n", restorepoint, status);
153 status->nStatus = ERROR_SUCCESS;
154 return FALSE;