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 revision = 0;
|
||||||
const unsigned char build = 10;
|
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()
|
char *CALLBACK PS2EgetLibName()
|
||||||
{
|
{
|
||||||
return LibName;
|
return LibName;
|
||||||
|
|
|
@ -87,8 +87,6 @@ extern IOCtlSrc *src;
|
||||||
|
|
||||||
void configure();
|
void configure();
|
||||||
|
|
||||||
extern HINSTANCE hinst;
|
|
||||||
|
|
||||||
void ReadSettings();
|
void ReadSettings();
|
||||||
void WriteSettings();
|
void WriteSettings();
|
||||||
std::wstring GetValidDrive();
|
std::wstring GetValidDrive();
|
||||||
|
|
|
@ -22,6 +22,16 @@
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include "resource.h"
|
#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)
|
static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
|
@ -111,6 +121,6 @@ void configure()
|
||||||
{
|
{
|
||||||
ReadSettings();
|
ReadSettings();
|
||||||
auto drives = GetOpticalDriveList();
|
auto drives = GetOpticalDriveList();
|
||||||
DialogBoxParam(hinst, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(),
|
DialogBoxParam(s_hinstance, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(),
|
||||||
ConfigProc, reinterpret_cast<LPARAM>(&drives));
|
ConfigProc, reinterpret_cast<LPARAM>(&drives));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue