mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:03:25 +00:00
[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 :) svn path=/trunk/; revision=63625
This commit is contained in:
parent
73f4d1ff00
commit
adc64f21ca
1 changed files with 38 additions and 27 deletions
|
@ -19,36 +19,47 @@ CPlApplet(HWND hwndCpl,
|
||||||
LPARAM lParam1,
|
LPARAM lParam1,
|
||||||
LPARAM lParam2)
|
LPARAM lParam2)
|
||||||
{
|
{
|
||||||
if (ODBCProc == NULL)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
TCHAR szBuffer[MAX_PATH];
|
case CPL_INIT:
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
|
case CPL_DBLCLK:
|
||||||
szBuffer,
|
{
|
||||||
sizeof(szBuffer) / sizeof(TCHAR)) > 0)
|
if (ODBCProc == NULL)
|
||||||
{
|
{
|
||||||
hLibrary = LoadLibrary(szBuffer);
|
TCHAR szBuffer[MAX_PATH];
|
||||||
if (hLibrary)
|
|
||||||
{
|
|
||||||
ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ODBCProc)
|
if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
|
||||||
{
|
szBuffer,
|
||||||
return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
|
sizeof(szBuffer) / sizeof(TCHAR)) > 0)
|
||||||
}
|
{
|
||||||
else
|
hLibrary = LoadLibrary(szBuffer);
|
||||||
{
|
if (hLibrary)
|
||||||
if(hLibrary)
|
{
|
||||||
{
|
ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
|
||||||
FreeLibrary(hLibrary);
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TerminateProcess(GetCurrentProcess(), -1);
|
if (ODBCProc)
|
||||||
return (LONG)-1;
|
{
|
||||||
}
|
return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (hLibrary)
|
||||||
|
{
|
||||||
|
FreeLibrary(hLibrary);
|
||||||
|
}
|
||||||
|
|
||||||
|
TerminateProcess(GetCurrentProcess(), -1);
|
||||||
|
return (LONG)-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue