Commit e3d681ba authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the COMMDLG_hInstance variables.

parent e743e091
......@@ -26,12 +26,6 @@
#include "wine/windef16.h"
#include "wownt32.h"
/*---------------- 16-bit ----------------*/
extern HINSTANCE16 COMMDLG_hInstance;
extern HINSTANCE COMMDLG_hInstance32;
/*---------------- 32-bit ----------------*/
/* Common dialogs implementation globals */
#define COMDLG32_Atom ((ATOM)0xa000) /* MS uses this one to identify props */
......
......@@ -1407,12 +1407,12 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
HGLOBAL hDlgTmpl32;
LPCVOID template32;
DWORD size;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_COLOR", RT_DIALOGA)))
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_COLOR", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo)) ||
if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo)) ||
!(template32 = LockResource(hDlgTmpl32)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -1492,12 +1492,12 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol )
{
HRSRC hResInfo;
HGLOBAL hDlgTmpl;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_COLOR", RT_DIALOGA)))
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_COLOR", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template = LockResource(hDlgTmpl)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -1505,7 +1505,7 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol )
}
}
bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template, lpChCol->hwndOwner,
bRet = DialogBoxIndirectParamW(COMDLG32_hInstance, template, lpChCol->hwndOwner,
ColorDlgProc, (DWORD)lpChCol);
return bRet;
}
......
......@@ -174,13 +174,13 @@ BOOL Get32BitsTemplate(LFSPRIVATE lfs)
}
} else { /* get it from internal Wine resource */
HRSRC hResInfo;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
lfs->open? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(lfs->template = LockResource( hDlgTmpl )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -230,13 +230,13 @@ BOOL Get16BitsTemplate(LFSPRIVATE lfs)
LPCVOID template32;
DWORD size;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
lfs->open ? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template32 = LockResource( hDlgTmpl32 )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......
......@@ -248,12 +248,12 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
/* Create the dialog from a template */
if(!(hRes = FindResourceA(COMMDLG_hInstance32,MAKEINTRESOURCEA(NEWFILEOPENORD),RT_DIALOGA)))
if(!(hRes = FindResourceA(COMDLG32_hInstance,MAKEINTRESOURCEA(NEWFILEOPENORD),RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hRes )) ||
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) ||
!(template = LockResource( hDlgTmpl )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -269,7 +269,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA);
}
lRes = DialogBoxIndirectParamA(COMMDLG_hInstance32,
lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
(LPDLGTEMPLATEA) template,
fodInfos->ofnInfos->hwndOwner,
FileOpenDlgProc95,
......@@ -990,7 +990,7 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
default:
stringId = 0;
}
lpdi->hinst = COMMDLG_hInstance32;
lpdi->hinst = COMDLG32_hInstance;
lpdi->lpszText = (LPSTR) stringId;
}
return FALSE;
......@@ -1070,7 +1070,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL,
WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE,
0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);
0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMDLG32_hInstance, NULL);
SetWindowPos(fodInfos->DlgInfos.hwndTB, 0,
rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top,
......@@ -1521,8 +1521,8 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
WCHAR tmp[400];
WCHAR nl[] = {'\n',0};
LoadStringW(COMMDLG_hInstance32, IDS_FILENOTFOUND, lpstrNotFound, 100);
LoadStringW(COMMDLG_hInstance32, IDS_VERIFYFILE, lpstrMsg, 100);
LoadStringW(COMDLG32_hInstance, IDS_FILENOTFOUND, lpstrNotFound, 100);
LoadStringW(COMDLG32_hInstance, IDS_VERIFYFILE, lpstrMsg, 100);
strcpyW(tmp, lpstrTemp);
strcatW(tmp, nl);
......
......@@ -102,7 +102,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr)
DWORD size;
HGLOBAL16 hGlobal16;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
lfr->find ?
MAKEINTRESOURCEA(FINDDLGORD):MAKEINTRESOURCEA(REPLACEDLGORD),
RT_DIALOGA)))
......@@ -110,7 +110,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr)
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template32 = LockResource( hDlgTmpl32 )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......
......@@ -242,12 +242,12 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
HGLOBAL hDlgTmpl32;
LPCVOID template32;
DWORD size;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_FONT", RT_DIALOGA)))
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_FONT", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo)) ||
if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo)) ||
!(template32 = LockResource(hDlgTmpl32)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -336,7 +336,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
}
} else
{
hDlginst=COMMDLG_hInstance32;
hDlginst=COMDLG32_hInstance;
if (!(hResInfo = FindResourceA(hDlginst, "CHOOSE_FONT", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
......@@ -356,7 +356,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS ))
FIXME(": unimplemented flag (ignored)\n");
return DialogBoxIndirectParamA(COMMDLG_hInstance32, template,
return DialogBoxIndirectParamA(COMDLG32_hInstance, template,
lpChFont->hwndOwner, FormatCharDlgProcA, (LPARAM)lpChFont );
}
......@@ -485,12 +485,12 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_FONT", RT_DIALOGA)))
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_FONT", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template = LockResource( hDlgTmpl )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
......@@ -508,7 +508,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
cf32a.lpLogFont=&lf32a;
cf32a.lpszStyle=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont->lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)&cf32a;
bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template,
bRet = DialogBoxIndirectParamW(COMDLG32_hInstance, template,
lpChFont->hwndOwner, FormatCharDlgProcW, (LPARAM)lpChFont );
HeapFree(GetProcessHeap(), 0, cf32a.lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)cf32a.lpTemplateName;
......@@ -805,7 +805,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
{
char name[30];
if( LoadStringA(COMMDLG_hInstance32, IDS_COLOR_BLACK+i, name,
if( LoadStringA(COMDLG32_hInstance, IDS_COLOR_BLACK+i, name,
sizeof(name)/sizeof(*name) )==0 )
{
strcpy( name, "[color name]" );
......
......@@ -29,10 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
HINSTANCE16 COMMDLG_hInstance = 0;
HINSTANCE COMMDLG_hInstance32 = 0;
static int COMMDLG_Attach = 0;
/***********************************************************************
* DllEntryPoint [COMMDLG.32]
*
......@@ -43,30 +39,6 @@ static int COMMDLG_Attach = 0;
BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
if (COMMDLG_Attach++) break;
COMMDLG_hInstance = hInst;
if(!COMMDLG_hInstance32)
{
if(!(COMMDLG_hInstance32 = LoadLibraryA("comdlg32.dll")))
{
ERR("Could not load sibling comdlg32.dll\n");
return FALSE;
}
}
break;
case DLL_PROCESS_DETACH:
if(!--COMMDLG_Attach)
{
COMMDLG_hInstance = 0;
if(COMMDLG_hInstance32)
FreeLibrary(COMMDLG_hInstance32);
}
break;
}
return TRUE;
}
......
......@@ -2109,19 +2109,19 @@ static HGLOBAL16 PRINTDLG_Get16TemplateFrom32(char *PrintResourceName)
HGLOBAL16 hGlobal16;
LPVOID template;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
PrintResourceName, RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return 0;
}
if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template32 = LockResource( hDlgTmpl32 )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
return 0;
}
size = SizeofResource(COMMDLG_hInstance32, hResInfo);
size = SizeofResource(COMDLG32_hInstance, hResInfo);
hGlobal16 = GlobalAlloc16(0, size);
if (!hGlobal16)
{
......
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