1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-09 15:38:21 +01:00
ExplorerPatcher/ExplorerPatcher/SettingsMonitor.h
Valentin Radu 04616cee16 Fixes for shell extension
* Properly implemented cleanup routines when injected into
applications other than Explorer
* Never EVER forget to specify a ThreadingModel for a COM object
in registry. That was the cause the DLL was making Microsoft Teams
crash on startup
* Do not free memory when the DLL is unloaded (DLL_PROCESS_DETACH)
and lpvReserved is non-NULL. It means the DLL is unloaded as the process
terminates, in which case all threads are dead, so it is not safe to call freeing
routines - let the operating system reclaim the memory on process exit
2021-11-11 07:00:44 +02:00

25 lines
546 B
C

#ifndef _H_SETTINGSMONITOR_H_
#define _H_SETTINGSMONITOR_H_
#include <Windows.h>
#include <Shlwapi.h>
#pragma comment(lib, "Shlwapi.lib")
#include <stdio.h>
typedef struct _Setting
{
HKEY origin;
wchar_t name[MAX_PATH];
HKEY hKey;
HANDLE hEvent;
void(__stdcall *callback)(void*);
void* data;
} Setting;
typedef struct _SettingsChangeParameters
{
Setting* settings;
DWORD size;
HANDLE hThread;
} SettingsChangeParameters;
DWORD WINAPI MonitorSettings(SettingsChangeParameters*);
#endif