ReactOS
0.4.16-dev-732-g2d1144a
odbccp32.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS ODBC Control Panel Applet
3
* FILE: dll/cpl/odbccp32/odbccp32.c
4
* PURPOSE: applet initialization
5
* PROGRAMMER: Johannes Anderwald
6
*/
7
8
#include "
odbccp32.h
"
9
10
HINSTANCE
hApplet
=
NULL
;
11
APPLET_PROC
ODBCProc
=
NULL
;
12
HMODULE
hLibrary
=
NULL
;
13
14
15
LONG
16
CALLBACK
17
CPlApplet
(
HWND
hwndCpl,
18
UINT
uMsg,
19
LPARAM
lParam1,
20
LPARAM
lParam2)
21
{
22
switch
(uMsg)
23
{
24
case
CPL_INIT
:
25
return
TRUE
;
26
27
case
CPL_DBLCLK
:
28
{
29
if
(
ODBCProc
==
NULL
)
30
{
31
TCHAR
szBuffer[
MAX_PATH
];
32
33
if
(
ExpandEnvironmentStrings
(
_T
(
"%systemroot%\\system32\\odbccp32.dll"
),
34
szBuffer,
35
sizeof
(szBuffer) /
sizeof
(
TCHAR
)) > 0)
36
{
37
hLibrary
=
LoadLibrary
(szBuffer);
38
if
(
hLibrary
)
39
{
40
ODBCProc
= (
APPLET_PROC
)
GetProcAddress
(
hLibrary
,
"ODBCCPlApplet"
);
41
}
42
}
43
}
44
45
if
(
ODBCProc
)
46
{
47
return
ODBCProc
(hwndCpl, uMsg, lParam1, lParam2);
48
}
49
else
50
{
51
if
(
hLibrary
)
52
{
53
FreeLibrary
(
hLibrary
);
54
}
55
56
TerminateProcess
(
GetCurrentProcess
(), -1);
57
return
(
LONG
)-1;
58
}
59
}
60
}
61
62
return
FALSE
;
63
}
64
65
66
BOOL
67
WINAPI
68
DllMain
(
HINSTANCE
hinstDLL,
69
DWORD
dwReason
,
70
LPVOID
lpReserved
)
71
{
72
INITCOMMONCONTROLSEX
InitControls
;
73
UNREFERENCED_PARAMETER
(
lpReserved
);
74
75
switch
(
dwReason
)
76
{
77
case
DLL_PROCESS_ATTACH
:
78
case
DLL_THREAD_ATTACH
:
79
{
80
InitControls
.dwSize =
sizeof
(
INITCOMMONCONTROLSEX
);
81
InitControls
.dwICC =
ICC_LISTVIEW_CLASSES
|
ICC_UPDOWN_CLASS
|
ICC_BAR_CLASSES
;
82
InitCommonControlsEx
(&
InitControls
);
83
84
hApplet
= hinstDLL;
85
break
;
86
}
87
}
88
89
return
TRUE
;
90
}
lpReserved
static DWORD const LPVOID const lpReserved
Definition:
appcrt_dllmain.cpp:58
dwReason
DWORD dwReason
Definition:
misc.cpp:135
InitCommonControlsEx
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition:
commctrl.c:900
ODBCProc
APPLET_PROC ODBCProc
Definition:
odbccp32.c:11
DllMain
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
Definition:
odbccp32.c:68
hApplet
HINSTANCE hApplet
Definition:
odbccp32.c:10
hLibrary
HMODULE hLibrary
Definition:
odbccp32.c:12
APPLET_PROC
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition:
cpl.h:23
CPL_DBLCLK
#define CPL_DBLCLK
Definition:
cpl.h:16
CPL_INIT
#define CPL_INIT
Definition:
cpl.h:12
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
DLL_PROCESS_ATTACH
#define DLL_PROCESS_ATTACH
Definition:
compat.h:131
GetProcAddress
#define GetProcAddress(x, y)
Definition:
compat.h:753
FreeLibrary
#define FreeLibrary(x)
Definition:
compat.h:748
GetCurrentProcess
#define GetCurrentProcess()
Definition:
compat.h:759
MAX_PATH
#define MAX_PATH
Definition:
compat.h:34
CALLBACK
#define CALLBACK
Definition:
compat.h:35
DLL_THREAD_ATTACH
#define DLL_THREAD_ATTACH
Definition:
compat.h:132
TerminateProcess
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition:
proc.c:1532
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
InitControls
static VOID InitControls(HWND hwnd)
Definition:
mplay32.c:303
UINT
unsigned int UINT
Definition:
ndis.h:50
UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(P)
Definition:
ntbasedef.h:325
odbccp32.h
LONG
long LONG
Definition:
pedump.c:60
INITCOMMONCONTROLSEX
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
ICC_UPDOWN_CLASS
#define ICC_UPDOWN_CLASS
Definition:
commctrl.h:62
ICC_BAR_CLASSES
#define ICC_BAR_CLASSES
Definition:
commctrl.h:60
ICC_LISTVIEW_CLASSES
#define ICC_LISTVIEW_CLASSES
Definition:
commctrl.h:58
CPlApplet
Definition:
cpanel.h:41
tagINITCOMMONCONTROLSEX
Definition:
commctrl.h:54
_T
#define _T(x)
Definition:
vfdio.h:22
ExpandEnvironmentStrings
#define ExpandEnvironmentStrings
Definition:
winbase.h:3799
LoadLibrary
#define LoadLibrary
Definition:
winbase.h:3887
LPARAM
LONG_PTR LPARAM
Definition:
windef.h:208
WINAPI
#define WINAPI
Definition:
msvc.h:6
TCHAR
char TCHAR
Definition:
xmlstorage.h:189
dll
cpl
odbccp32
odbccp32.c
Generated on Sat Feb 8 2025 06:04:34 for ReactOS by
1.9.6