xref: /reactos/dll/win32/sfcfiles/sfcfiles.c (revision f59c58d8)
1 /*
2  * PROJECT:     ReactOS System File Checker
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * FILE:        dll/win32/sfcfiles/sfcfiles.c
5  * PURPOSE:     List of protected files
6  * PROGRAMMERS: Copyright 2022 Eric Kohl (eric.kohl@reactos.org)
7  */
8 
9 #define WIN32_NO_STATUS
10 #include <windef.h>
11 #include <winbase.h>
12 #include <ndk/umtypes.h>
13 #include <sfcfiles.h>
14 
15 
16 static
17 PROTECT_FILE_ENTRY
18 ProtectedFiles[] =
19 {
20     {NULL, L"%systemroot%\\system32\\advapi32.dll", NULL},
21     {NULL, L"%systemroot%\\system32\\comctl32.dll", NULL},
22     {NULL, L"%systemroot%\\system32\\comdlg32.dll", NULL},
23     {NULL, L"%systemroot%\\system32\\kernel32.dll", NULL},
24     {NULL, L"%systemroot%\\system32\\ntdll.dll", NULL},
25     {NULL, L"%systemroot%\\system32\\ntoskrnl.exe", NULL}
26 };
27 
28 
29 BOOL
30 WINAPI
31 DllMain(
32     _In_ HINSTANCE hInstDLL,
33     _In_ DWORD fdwReason,
34     _In_ LPVOID lpvReserved)
35 {
36     switch (fdwReason)
37     {
38         case DLL_PROCESS_ATTACH:
39             DisableThreadLibraryCalls(hInstDLL);
40             break;
41 
42         case DLL_PROCESS_DETACH:
43             break;
44     }
45 
46     return TRUE;
47 }
48 
49 
50 NTSTATUS
51 WINAPI
52 SfcGetFiles(
53     _Out_ PPROTECT_FILE_ENTRY *ProtFileData,
54     _Out_ PULONG FileCount)
55 {
56     *ProtFileData = ProtectedFiles;
57     *FileCount = ARRAYSIZE(ProtectedFiles);
58     return STATUS_SUCCESS;
59 }
60