[SFCFILES] Add sfcfiles dll and header file

Sfcfiles.dll contains only a short list of protected files (WIP).
This commit is contained in:
Eric Kohl 2022-01-22 13:28:50 +01:00
parent 4cf9b7985e
commit 085f135f1a
6 changed files with 101 additions and 0 deletions

View file

@ -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)

View 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)

View 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;
}

View 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>

View file

@ -0,0 +1 @@
@ stdcall SfcGetFiles(ptr ptr)

View 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