ReactOS 0.4.16-dev-136-g52192f1
odbccp32.c File Reference
#include "odbccp32.h"
Include dependency graph for odbccp32.c:

Go to the source code of this file.

Functions

LONG CALLBACK CPlApplet (HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
 

Variables

HINSTANCE hApplet = NULL
 
APPLET_PROC ODBCProc = NULL
 
HMODULE hLibrary = NULL
 

Function Documentation

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCpl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 17 of file odbccp32.c.

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 {
54 }
55
57 return (LONG)-1;
58 }
59 }
60 }
61
62 return FALSE;
63}
APPLET_PROC ODBCProc
Definition: odbccp32.c:11
HMODULE hLibrary
Definition: odbccp32.c:12
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition: cpl.h:23
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
long LONG
Definition: pedump.c:60
#define _T(x)
Definition: vfdio.h:22
#define ExpandEnvironmentStrings
Definition: winbase.h:3774
#define LoadLibrary
Definition: winbase.h:3862
char TCHAR
Definition: xmlstorage.h:189

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 68 of file odbccp32.c.

71{
73 UNREFERENCED_PARAMETER(lpReserved);
74
75 switch(dwReason)
76 {
79 {
80 InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
83
84 hApplet = hinstDLL;
85 break;
86 }
87 }
88
89 return TRUE;
90}
DWORD dwReason
Definition: misc.cpp:141
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
HINSTANCE hApplet
Definition: odbccp32.c:10
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_THREAD_ATTACH
Definition: compat.h:132
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58

Variable Documentation

◆ hApplet

HINSTANCE hApplet = NULL

Definition at line 10 of file odbccp32.c.

Referenced by DllMain().

◆ hLibrary

◆ ODBCProc

APPLET_PROC ODBCProc = NULL

Definition at line 11 of file odbccp32.c.

Referenced by CPlApplet().