1999-02-28 21:05:11 +01:00
|
|
|
/*
|
1999-03-15 16:16:54 +01:00
|
|
|
* COMMDLG/COMDLG32 functions
|
1999-02-28 21:05:11 +01:00
|
|
|
*
|
|
|
|
* Copyright 1994 Martin Ayotte
|
|
|
|
* Copyright 1996 Albrecht Kleine
|
1999-04-25 20:31:35 +02:00
|
|
|
* Copyright 1998,1999 Bertho Stultiens
|
1999-02-28 21:05:11 +01:00
|
|
|
* Copyright 1999 Klaas van Gend
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "commdlg.h"
|
1999-06-12 17:45:58 +02:00
|
|
|
#include "debugtools.h"
|
1999-02-28 21:05:11 +01:00
|
|
|
|
2000-11-28 00:54:25 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(commdlg);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1999-04-25 20:31:35 +02:00
|
|
|
#include "cdlg.h"
|
1999-03-15 16:16:54 +01:00
|
|
|
|
1999-04-25 20:31:35 +02:00
|
|
|
HINSTANCE16 COMMDLG_hInstance = 0;
|
|
|
|
HINSTANCE COMMDLG_hInstance32 = 0;
|
|
|
|
static int COMMDLG_Attach = 0;
|
1999-03-15 16:16:54 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* DllEntryPoint [COMMDLG.32]
|
1999-03-15 16:16:54 +01:00
|
|
|
*
|
1999-04-25 20:31:35 +02:00
|
|
|
* Initialization code for the COMMDLG DLL
|
1999-03-15 16:16:54 +01:00
|
|
|
*
|
|
|
|
* RETURNS:
|
|
|
|
*/
|
1999-04-25 20:31:35 +02:00
|
|
|
BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
|
1999-02-28 21:05:11 +01:00
|
|
|
{
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
|
1999-04-25 20:31:35 +02:00
|
|
|
switch(Reason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2001-01-17 23:03:18 +01:00
|
|
|
if (COMMDLG_Attach++) break;
|
1999-04-25 20:31:35 +02:00
|
|
|
COMMDLG_hInstance = hInst;
|
|
|
|
if(!COMMDLG_hInstance32)
|
|
|
|
{
|
|
|
|
if(!(COMMDLG_hInstance32 = LoadLibraryA("comdlg32.dll")))
|
|
|
|
{
|
1999-06-12 17:45:58 +02:00
|
|
|
ERR("Could not load sibling comdlg32.dll\n");
|
1999-04-25 20:31:35 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if(!--COMMDLG_Attach)
|
|
|
|
{
|
|
|
|
COMMDLG_hInstance = 0;
|
|
|
|
if(COMMDLG_hInstance32)
|
|
|
|
FreeLibrary(COMMDLG_hInstance32);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
1999-02-28 21:05:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-03-15 16:16:54 +01:00
|
|
|
/***********************************************************************
|
1999-04-25 20:31:35 +02:00
|
|
|
* CommDlgExtendedError16 [COMMDLG.26]
|
|
|
|
*
|
|
|
|
* Get the last error value if a commdlg function fails.
|
1999-03-15 16:16:54 +01:00
|
|
|
* RETURNS
|
|
|
|
* Current error value which might not be valid
|
|
|
|
* if a previous call succeeded.
|
|
|
|
*/
|
1999-04-25 20:31:35 +02:00
|
|
|
DWORD WINAPI CommDlgExtendedError16(void)
|
1999-03-15 16:16:54 +01:00
|
|
|
{
|
1999-04-25 20:31:35 +02:00
|
|
|
return CommDlgExtendedError();
|
1999-03-15 16:16:54 +01:00
|
|
|
}
|