user32: Clear %edi register when calling window procedure.
[wine.git] / dlls / sfc_os / sfc_os.c
blob6193dda43ef6d342f777b062c382f692104be9d8
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);
59 SetLastError(ERROR_NO_MORE_FILES);
60 return FALSE;
63 /******************************************************************
64 * SfcIsFileProtected [sfc_os.@]
66 * Check, if the given File is protected by the System
68 * PARAMS
69 * RpcHandle [I] This must be NULL
70 * ProtFileName [I] Filename with Path to check
72 * RETURNS
73 * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND
74 * Success: TRUE, when the File is Protected
75 * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND,
76 * when the File is not Protected
79 * BUGS
80 * We return always the Result for: "File is not Protected"
83 BOOL WINAPI SfcIsFileProtected(HANDLE RpcHandle, LPCWSTR ProtFileName)
85 static BOOL reported = FALSE;
87 if (reported) {
88 TRACE("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
90 else
92 FIXME("(%p, %s) stub\n", RpcHandle, debugstr_w(ProtFileName));
93 reported = TRUE;
96 SetLastError(ERROR_FILE_NOT_FOUND);
97 return FALSE;
100 /******************************************************************
101 * SfcIsKeyProtected [sfc_os.@]
103 * Check, if the given Registry Key is protected by the System
105 * PARAMS
106 * hKey [I] Handle to the root registry key
107 * lpSubKey [I] Name of the subkey to check
108 * samDesired [I] The Registry View to Examine (32 or 64 bit)
110 * RETURNS
111 * Failure: FALSE with GetLastError() != ERROR_FILE_NOT_FOUND
112 * Success: TRUE, when the Key is Protected
113 * FALSE with GetLastError() == ERROR_FILE_NOT_FOUND,
114 * when the Key is not Protected
117 BOOL WINAPI SfcIsKeyProtected(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired)
119 static BOOL reported = FALSE;
121 if (reported) {
122 TRACE("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
124 else
126 FIXME("(%p, %s) stub\n", hKey, debugstr_w(lpSubKey));
127 reported = TRUE;
130 if( !hKey ) {
131 SetLastError(ERROR_INVALID_HANDLE);
132 return FALSE;
135 SetLastError(ERROR_FILE_NOT_FOUND);
136 return FALSE;
139 DWORD WINAPI SfcConnectToServer(DWORD unknown)
141 FIXME("%x\n", unknown);
142 return 0;
145 BOOL WINAPI SRSetRestorePointA(RESTOREPOINTINFOA *restorepoint, STATEMGRSTATUS *status)
147 FIXME("%p %p\n", restorepoint, status);
148 status->nStatus = ERROR_SUCCESS;
149 return FALSE;
152 BOOL WINAPI SRSetRestorePointW(RESTOREPOINTINFOW *restorepoint, STATEMGRSTATUS *status)
154 FIXME("%p %p\n", restorepoint, status);
155 status->nStatus = ERROR_SUCCESS;
156 return FALSE;