Pass -l's that are not .dll's or .a's to the linker.
[wine] / dlls / commdlg / generic.c
1 /*
2  * COMMDLG/COMDLG32 functions
3  *
4  * Copyright 1994 Martin Ayotte
5  * Copyright 1996 Albrecht Kleine
6  * Copyright 1998,1999 Bertho Stultiens
7  * Copyright 1999 Klaas van Gend
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23
24 #include "winbase.h"
25 #include "commdlg.h"
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
29
30 #include "cdlg.h"
31
32 HINSTANCE16     COMMDLG_hInstance = 0;
33 HINSTANCE       COMMDLG_hInstance32 = 0;
34 static int      COMMDLG_Attach = 0;
35
36 /***********************************************************************
37  *      DllEntryPoint                   [COMMDLG.32]
38  *
39  *    Initialization code for the COMMDLG DLL
40  *
41  * RETURNS:
42  */
43 BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
44 {
45         TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
46         switch(Reason)
47         {
48         case DLL_PROCESS_ATTACH:
49                 if (COMMDLG_Attach++) break;
50                 COMMDLG_hInstance = hInst;
51                 if(!COMMDLG_hInstance32)
52                 {
53                         if(!(COMMDLG_hInstance32 = LoadLibraryA("comdlg32.dll")))
54                         {
55                                 ERR("Could not load sibling comdlg32.dll\n");
56                                 return FALSE;
57                         }
58                 }
59                 break;
60
61         case DLL_PROCESS_DETACH:
62                 if(!--COMMDLG_Attach)
63                 {
64                         COMMDLG_hInstance = 0;
65                         if(COMMDLG_hInstance32)
66                                 FreeLibrary(COMMDLG_hInstance32);
67                 }
68                 break;
69         }
70         return TRUE;
71 }
72
73
74 /***********************************************************************
75  *      CommDlgExtendedError16                  [COMMDLG.26]
76  *
77  * Get the last error value if a commdlg function fails.
78  *      RETURNS
79  *              Current error value which might not be valid
80  *              if a previous call succeeded.
81  */
82 DWORD WINAPI CommDlgExtendedError16(void)
83 {
84         return CommDlgExtendedError();
85 }