Author: hbelusca
Date: Sun Jun 22 09:33:46 2014
New Revision: 63625
URL:
http://svn.reactos.org/svn/reactos?rev=63625&view=rev
Log:
[ODBCCP32]
The control panel automatically runs this applet without clicking on it, fix this wrong
behaviour.
Patch by Lee Schröder
CORE-8323 #resolve #comment Thanks :)
Modified:
trunk/reactos/dll/cpl/odbccp32/odbccp32.c
Modified: trunk/reactos/dll/cpl/odbccp32/odbccp32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/odbccp32.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/odbccp32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/odbccp32/odbccp32.c [iso-8859-1] Sun Jun 22 09:33:46 2014
@@ -19,36 +19,47 @@
LPARAM lParam1,
LPARAM lParam2)
{
- if (ODBCProc == NULL)
- {
- TCHAR szBuffer[MAX_PATH];
+ switch (uMsg)
+ {
+ case CPL_INIT:
+ return TRUE;
- if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
- szBuffer,
- sizeof(szBuffer) / sizeof(TCHAR)) > 0)
- {
- hLibrary = LoadLibrary(szBuffer);
- if (hLibrary)
- {
- ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
- }
- }
- }
+ case CPL_DBLCLK:
+ {
+ if (ODBCProc == NULL)
+ {
+ TCHAR szBuffer[MAX_PATH];
- if (ODBCProc)
- {
- return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
- }
- else
- {
- if(hLibrary)
- {
- FreeLibrary(hLibrary);
- }
+ if
(ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
+ szBuffer,
+ sizeof(szBuffer) / sizeof(TCHAR)) > 0)
+ {
+ hLibrary = LoadLibrary(szBuffer);
+ if (hLibrary)
+ {
+ ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary,
"ODBCCPlApplet");
+ }
+ }
+ }
- TerminateProcess(GetCurrentProcess(), -1);
- return (LONG)-1;
- }
+ if (ODBCProc)
+ {
+ return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
+ }
+ else
+ {
+ if (hLibrary)
+ {
+ FreeLibrary(hLibrary);
+ }
+
+ TerminateProcess(GetCurrentProcess(), -1);
+ return (LONG)-1;
+ }
+ }
+ }
+
+ return FALSE;
}