Commit 0bb4bddf authored by Alexandre Julliard's avatar Alexandre Julliard

Store the module instance we get in DllMain to avoid extra LoadLibrary

calls.
parent c3116c5e
...@@ -349,7 +349,7 @@ INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput, ...@@ -349,7 +349,7 @@ INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
/* If DM_PROMPT is set, present modal dialog box */ /* If DM_PROMPT is set, present modal dialog box */
if(dwMode & DM_PROMPT) { if(dwMode & DM_PROMPT) {
HINSTANCE hinstComctl32, hinstWineps32 = LoadLibraryA("WINEPS"); HINSTANCE hinstComctl32;
HPROPSHEETPAGE hpsp[1]; HPROPSHEETPAGE hpsp[1];
PROPSHEETPAGEW psp; PROPSHEETPAGEW psp;
PROPSHEETHEADERW psh; PROPSHEETHEADERW psh;
...@@ -371,7 +371,7 @@ INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput, ...@@ -371,7 +371,7 @@ INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
di->pi = pi; di->pi = pi;
di->dlgdm = dlgdm; di->dlgdm = dlgdm;
psp.dwSize = sizeof(psp); psp.dwSize = sizeof(psp);
psp.hInstance = hinstWineps32; psp.hInstance = PSDRV_hInstance;
psp.u.pszTemplate = PAPERW; psp.u.pszTemplate = PAPERW;
psp.u2.pszIcon = NULL; psp.u2.pszIcon = NULL;
psp.pfnDlgProc = PSDRV_PaperDlgProc; psp.pfnDlgProc = PSDRV_PaperDlgProc;
......
...@@ -101,6 +101,7 @@ static PSDRV_DEVMODEA DefaultDevmode = ...@@ -101,6 +101,7 @@ static PSDRV_DEVMODEA DefaultDevmode =
} }
}; };
HINSTANCE PSDRV_hInstance = 0;
HANDLE PSDRV_Heap = 0; HANDLE PSDRV_Heap = 0;
static HFONT PSDRV_DefaultFont = 0; static HFONT PSDRV_DefaultFont = 0;
...@@ -122,6 +123,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) ...@@ -122,6 +123,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
switch(reason) { switch(reason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
PSDRV_hInstance = hinst;
DisableThreadLibraryCalls(hinst); DisableThreadLibraryCalls(hinst);
PSDRV_Heap = HeapCreate(0, 0x10000, 0); PSDRV_Heap = HeapCreate(0, 0x10000, 0);
......
...@@ -381,6 +381,7 @@ extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver, ...@@ -381,6 +381,7 @@ extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode); LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
extern HINSTANCE PSDRV_hInstance;
extern HANDLE PSDRV_Heap; extern HANDLE PSDRV_Heap;
extern char *PSDRV_ANSIVector[256]; extern char *PSDRV_ANSIVector[256];
...@@ -394,8 +395,6 @@ extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, ...@@ -394,8 +395,6 @@ extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
BOOL *p_added); BOOL *p_added);
extern void PSDRV_FreeAFMList( FONTFAMILY *head ); extern void PSDRV_FreeAFMList( FONTFAMILY *head );
extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved);
extern INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width ); extern INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width );
extern INT PSDRV_YWStoDS( PSDRV_PDEVICE *physDev, INT height ); extern INT PSDRV_YWStoDS( PSDRV_PDEVICE *physDev, INT height );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment