openDecal/Native/InjectModern/Inject.h
erik d1442e3747 Initial commit: Complete open-source Decal rebuild
All 5 phases of the open-source Decal rebuild:

Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil)
Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs
  - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters
  - Decal.Core, DecalControls, DecalRender, D3DService
Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL
Phase 4: DenAgent WinForms tray application
Phase 5: WiX installer and build script

25 C# projects building with 0 errors.
Native C++ projects require VS 2022 + Windows SDK (x86).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:27:56 +01:00

37 lines
1.4 KiB
C

// Inject.h - Public declarations for Inject.DLL
#pragma once
#ifdef INJECT_EXPORTS
#define INJECT_API __declspec(dllexport)
#else
#define INJECT_API __declspec(dllimport)
#endif
// Lifecycle exports
extern "C" INJECT_API void __stdcall DecalStartup();
extern "C" INJECT_API void __stdcall Container_Initialize(HWND hWnd, void* pDevice);
extern "C" INJECT_API void __stdcall Container_StartPlugins();
extern "C" INJECT_API void __stdcall Container_StopPlugins();
extern "C" INJECT_API void __stdcall Container_Terminate();
extern "C" INJECT_API void __stdcall Container_Draw();
// D3D9 vtable hooking utilities
extern "C" INJECT_API BOOL __stdcall HookVTable(void* pInterface, int nIndex, void* pNewFunction);
extern "C" INJECT_API BOOL __stdcall UnhookVTable(void* pInterface, int nIndex);
extern "C" INJECT_API void* __stdcall GetVTableEntry(void* pInterface, int nIndex);
// Memory patching
extern "C" INJECT_API BOOL __stdcall PatchMemory(void* pAddress, const void* pData, DWORD dwSize);
// Original D3D9 function pointers (for DecalRender/D3DService to call through)
extern "C" INJECT_API void* BeginSceneO;
extern "C" INJECT_API void* EndSceneO;
// Path mapping
extern "C" INJECT_API LPTSTR __stdcall InjectMapPath(int pathType, LPCTSTR szFilename, LPTSTR szBuffer);
// COM server standard exports
STDAPI DllCanUnloadNow();
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
STDAPI DllRegisterServer();
STDAPI DllUnregisterServer();