ReactOS  0.4.14-dev-323-g6fe6a88
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 }
#define TRUE
Definition: types.h:120
#define LoadLibrary
Definition: winbase.h:3686
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition: cpl.h:23
#define ExpandEnvironmentStrings
Definition: winbase.h:3598
#define CPL_DBLCLK
Definition: cpl.h:16
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:405
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define MAX_PATH
Definition: compat.h:26
#define CPL_INIT
Definition: cpl.h:12
HMODULE hLibrary
Definition: odbccp32.c:12
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
APPLET_PROC ODBCProc
Definition: odbccp32.c:11
#define GetProcAddress(x, y)
Definition: compat.h:410

◆ 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  {
77  case DLL_PROCESS_ATTACH:
78  case DLL_THREAD_ATTACH:
79  {
80  InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
83 
84  hApplet = hinstDLL;
85  break;
86  }
87  }
88 
89  return TRUE;
90 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define DLL_THREAD_ATTACH
Definition: compat.h:121
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
DWORD dwReason
Definition: misc.cpp:154
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
HINSTANCE hApplet
Definition: odbccp32.c:10
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#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().