mirror of https://github.com/PCSX2/pcsx2.git
cdvdgigaherz: Move dllmain to a Windows only file
This commit is contained in:
parent
d7866831ae
commit
b1850f2465
|
@ -61,20 +61,6 @@ const unsigned char version = PS2E_CDVD_VERSION;
|
|||
const unsigned char revision = 0;
|
||||
const unsigned char build = 10;
|
||||
|
||||
HINSTANCE hinst;
|
||||
|
||||
BOOL WINAPI DllMain(
|
||||
HINSTANCE hinstDLL, // handle to DLL module
|
||||
DWORD fdwReason, // reason for calling function
|
||||
LPVOID lpvReserved // reserved
|
||||
)
|
||||
{
|
||||
if (fdwReason == DLL_PROCESS_ATTACH) {
|
||||
hinst = hinstDLL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *CALLBACK PS2EgetLibName()
|
||||
{
|
||||
return LibName;
|
||||
|
|
|
@ -87,8 +87,6 @@ extern IOCtlSrc *src;
|
|||
|
||||
void configure();
|
||||
|
||||
extern HINSTANCE hinst;
|
||||
|
||||
void ReadSettings();
|
||||
void WriteSettings();
|
||||
std::wstring GetValidDrive();
|
||||
|
|
|
@ -22,6 +22,16 @@
|
|||
#include <codecvt>
|
||||
#include "resource.h"
|
||||
|
||||
static HINSTANCE s_hinstance;
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
s_hinstance = hinstance;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg) {
|
||||
|
@ -111,6 +121,6 @@ void configure()
|
|||
{
|
||||
ReadSettings();
|
||||
auto drives = GetOpticalDriveList();
|
||||
DialogBoxParam(hinst, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(),
|
||||
DialogBoxParam(s_hinstance, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(),
|
||||
ConfigProc, reinterpret_cast<LPARAM>(&drives));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue