Repository navigation
Expand file tree
/
Copy pathDllMain.cpp
More file actions
42 lines (36 loc) · 1.43 KB
/
Copy pathDllMain.cpp
File metadata and controls
42 lines (36 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/***************************************************************************************************
* Xidi
* DirectInput interface for XInput controllers.
***************************************************************************************************
* Authored by Samuel Grossman
* Copyright (c) 2016-2026
***********************************************************************************************//**
* @file DllMain.cpp
* Entry point when loading or unloading this dynamic library.
**************************************************************************************************/
#include "ApiWindows.h"
#include "Globals.h"
/// Performs library initialization and teardown functions.
/// Invoked automatically by the operating system.
/// Refer to Windows documentation for more information.
/// @param [in] hModule Instance handle for this library.
/// @param [in] ulReasonForCall Specifies the event that caused this function to be invoked.
/// @param [in] lpReserved Reserved.
/// @return `TRUE` if this function successfully initialized or uninitialized this library, `FALSE`
/// otherwise.
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ulReasonForCall, LPVOID lpReserved)
{
switch (ulReasonForCall)
{
case DLL_PROCESS_ATTACH:
Xidi::Globals::Initialize();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}