Removed W->A from DEFWND_ImmIsUIMessageW.
[wine] / dlls / advpack / advpack.c
1 /*
2  * Advpack main
3  *
4  * Copyright 2004 Huw D M Davies
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "setupapi.h"
27 #include "advpub.h"
28 #include "wine/debug.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(advpack);
31
32
33 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
34 {
35     TRACE("(%p, %ld, %p)\n",hinstDLL, fdwReason, lpvReserved);
36
37     if (fdwReason == DLL_PROCESS_ATTACH)
38         DisableThreadLibraryCalls(hinstDLL);
39
40     return TRUE;
41 }
42
43 /***********************************************************************
44  *              LaunchINFSection  (SETUPAPI.@)
45  */
46 void WINAPI LaunchINFSection( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show )
47 {
48     FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(cmdline), show );
49 }
50
51 /***********************************************************************
52  *              LaunchINFSectionEx  (SETUPAPI.@)
53  */
54 void WINAPI LaunchINFSectionEx( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show )
55 {
56     FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(cmdline), show );
57 }
58
59 /* this structure very closely resembles parameters of RunSetupCommand() */
60 typedef struct
61 {
62     HWND hwnd;
63     LPCSTR title;
64     LPCSTR inf_name;
65     LPCSTR dir;
66     LPCSTR section_name;
67 } SETUPCOMMAND_PARAMS;
68
69 /***********************************************************************
70  *              DoInfInstall  (ADVPACK.@)
71  */
72 BOOL WINAPI DoInfInstall(const SETUPCOMMAND_PARAMS *setup)
73 {
74     BOOL ret;
75     HINF hinf;
76     void *callback_context;
77
78     TRACE("%p %s %s %s %s\n", setup->hwnd, debugstr_a(setup->title),
79           debugstr_a(setup->inf_name), debugstr_a(setup->dir),
80           debugstr_a(setup->section_name));
81
82     hinf = SetupOpenInfFileA(setup->inf_name, NULL, INF_STYLE_WIN4, NULL);
83     if (hinf == INVALID_HANDLE_VALUE) return FALSE;
84
85     callback_context = SetupInitDefaultQueueCallback(setup->hwnd);
86
87     ret = SetupInstallFromInfSectionA(NULL, hinf, setup->section_name, SPINST_ALL,
88                                       NULL, NULL, 0, SetupDefaultQueueCallbackA,
89                                       callback_context, NULL, NULL);
90     SetupTermDefaultQueueCallback(callback_context);
91     SetupCloseInfFile(hinf);
92
93     return ret;
94 }