mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
[SFCFILES] Add sfcfiles dll and header file
Sfcfiles.dll contains only a short list of protected files (WIP).
This commit is contained in:
parent
4cf9b7985e
commit
085f135f1a
6 changed files with 101 additions and 0 deletions
|
@ -184,6 +184,7 @@ add_subdirectory(serialui)
|
|||
add_subdirectory(setupapi)
|
||||
add_subdirectory(sfc)
|
||||
add_subdirectory(sfc_os)
|
||||
add_subdirectory(sfcfiles)
|
||||
add_subdirectory(shdoclc)
|
||||
add_subdirectory(shdocvw)
|
||||
add_subdirectory(shell32)
|
||||
|
|
10
dll/win32/sfcfiles/CMakeLists.txt
Normal file
10
dll/win32/sfcfiles/CMakeLists.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
spec2def(sfcfiles.dll sfcfiles.spec)
|
||||
|
||||
list(APPEND SOURCE
|
||||
sfcfiles.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sfcfiles.def)
|
||||
|
||||
add_library(sfcfiles MODULE ${SOURCE})
|
||||
set_module_type(sfcfiles win32dll)
|
||||
add_importlibs(sfcfiles msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET sfcfiles DESTINATION reactos/system32 FOR all)
|
59
dll/win32/sfcfiles/sfcfiles.c
Normal file
59
dll/win32/sfcfiles/sfcfiles.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* PROJECT: ReactOS System File Checker
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* FILE: dll/win32/sfcfiles/sfcfiles.c
|
||||
* PURPOSE: List of protected files
|
||||
* PROGRAMMERS: Copyright 2022 Eric Kohl (eric.kohl@reactos.org)
|
||||
*/
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <ndk/umtypes.h>
|
||||
#include <sfcfiles.h>
|
||||
|
||||
|
||||
static
|
||||
PROTECT_FILE_ENTRY
|
||||
ProtectedFiles[] =
|
||||
{
|
||||
{NULL, L"%systemroot%\\system32\\advapi32.dll", NULL},
|
||||
{NULL, L"%systemroot%\\system32\\comctl32.dll", NULL},
|
||||
{NULL, L"%systemroot%\\system32\\comdlg32.dll", NULL},
|
||||
{NULL, L"%systemroot%\\system32\\kernel32.dll", NULL},
|
||||
{NULL, L"%systemroot%\\system32\\ntdll.dll", NULL},
|
||||
{NULL, L"%systemroot%\\system32\\ntoskrnl.exe", NULL}
|
||||
};
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(
|
||||
_In_ HINSTANCE hInstDLL,
|
||||
_In_ DWORD fdwReason,
|
||||
_In_ LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hInstDLL);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
SfcGetFiles(
|
||||
_Out_ PPROTECT_FILE_ENTRY *ProtFileData,
|
||||
_Out_ PULONG FileCount)
|
||||
{
|
||||
*ProtFileData = ProtectedFiles;
|
||||
*FileCount = ARRAYSIZE(ProtectedFiles);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
5
dll/win32/sfcfiles/sfcfiles.rc
Normal file
5
dll/win32/sfcfiles/sfcfiles.rc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "System File Checker Files"
|
||||
#define REACTOS_STR_INTERNAL_NAME "sfcfiles"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "sfcfiles.dll"
|
||||
#include <reactos/version.rc>
|
1
dll/win32/sfcfiles/sfcfiles.spec
Normal file
1
dll/win32/sfcfiles/sfcfiles.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall SfcGetFiles(ptr ptr)
|
25
sdk/include/psdk/sfcfiles.h
Normal file
25
sdk/include/psdk/sfcfiles.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef __SFCFILES_H
|
||||
#define __SFCFILES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _PROTECT_FILE_ENTRY
|
||||
{
|
||||
PWSTR SourceFileName;
|
||||
PWSTR FileName;
|
||||
PWSTR InfName;
|
||||
} PROTECT_FILE_ENTRY, *PPROTECT_FILE_ENTRY;
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
SfcGetFiles(
|
||||
_Out_ PPROTECT_FILE_ENTRY *ProtFileData,
|
||||
_Out_ PULONG FileCount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue