mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
[ODBCCP32] Sync with Wine Staging 1.7.55. CORE-10536
svn path=/trunk/; revision=70052
This commit is contained in:
parent
f0a73f0bf1
commit
8c1459cee5
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||||
|
add_definitions(-D_WIN32_WINNT=0x600)
|
||||||
|
|
||||||
add_definitions(-D__WINESRC__)
|
add_definitions(-D__WINESRC__)
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||||
spec2def(odbccp32.dll odbccp32.spec ADD_IMPORTLIB)
|
spec2def(odbccp32.dll odbccp32.spec ADD_IMPORTLIB)
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
#define NONAMELESSUNION
|
|
||||||
|
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
|
@ -40,6 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(odbc);
|
||||||
|
|
||||||
/* Registry key names */
|
/* Registry key names */
|
||||||
static const WCHAR drivers_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\','O','D','B','C',' ','D','r','i','v','e','r','s',0};
|
static const WCHAR drivers_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\','O','D','B','C',' ','D','r','i','v','e','r','s',0};
|
||||||
|
static const WCHAR odbcW[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C',0};
|
||||||
|
|
||||||
/* This config mode is known to be process-wide.
|
/* This config mode is known to be process-wide.
|
||||||
* MSDN documentation suggests that the value is hidden somewhere in the registry but I haven't found it yet.
|
* MSDN documentation suggests that the value is hidden somewhere in the registry but I haven't found it yet.
|
||||||
|
@ -402,28 +402,176 @@ BOOL WINAPI SQLGetInstalledDrivers(LPSTR lpszBuf, WORD cbBufMax,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI SQLGetPrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry,
|
static HKEY get_privateprofile_sectionkey(LPCWSTR section, LPCWSTR filename)
|
||||||
LPCWSTR lpszDefault, LPCWSTR RetBuffer, int cbRetBuffer,
|
|
||||||
LPCWSTR lpszFilename)
|
|
||||||
{
|
{
|
||||||
clear_errors();
|
HKEY hkey, hkeyfilename, hkeysection;
|
||||||
FIXME("%s %s %s %p %d %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry),
|
LONG ret;
|
||||||
debugstr_w(lpszDefault), RetBuffer, cbRetBuffer,
|
|
||||||
debugstr_w(lpszFilename));
|
if (RegOpenKeyW(HKEY_CURRENT_USER, odbcW, &hkey))
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
return NULL;
|
||||||
return FALSE;
|
|
||||||
|
ret = RegOpenKeyW(hkey, filename, &hkeyfilename);
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
if (ret)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ret = RegOpenKeyW(hkeyfilename, section, &hkeysection);
|
||||||
|
RegCloseKey(hkeyfilename);
|
||||||
|
|
||||||
|
return ret ? NULL : hkeysection;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI SQLGetPrivateProfileString(LPCSTR lpszSection, LPCSTR lpszEntry,
|
int WINAPI SQLGetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry,
|
||||||
LPCSTR lpszDefault, LPCSTR RetBuffer, int cbRetBuffer,
|
LPCWSTR defvalue, LPWSTR buff, int buff_len, LPCWSTR filename)
|
||||||
LPCSTR lpszFilename)
|
|
||||||
{
|
{
|
||||||
|
BOOL usedefault = TRUE;
|
||||||
|
HKEY sectionkey;
|
||||||
|
LONG ret = 0;
|
||||||
|
|
||||||
|
TRACE("%s %s %s %p %d %s\n", debugstr_w(section), debugstr_w(entry),
|
||||||
|
debugstr_w(defvalue), buff, buff_len, debugstr_w(filename));
|
||||||
|
|
||||||
clear_errors();
|
clear_errors();
|
||||||
FIXME("%s %s %s %p %d %s\n", debugstr_a(lpszSection), debugstr_a(lpszEntry),
|
|
||||||
debugstr_a(lpszDefault), RetBuffer, cbRetBuffer,
|
if (buff_len <= 0 || !section)
|
||||||
debugstr_a(lpszFilename));
|
return 0;
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return FALSE;
|
if(buff)
|
||||||
|
buff[0] = 0;
|
||||||
|
|
||||||
|
if (!defvalue || !buff)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
sectionkey = get_privateprofile_sectionkey(section, filename);
|
||||||
|
if (sectionkey)
|
||||||
|
{
|
||||||
|
DWORD type, size;
|
||||||
|
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
size = buff_len * sizeof(*buff);
|
||||||
|
if (RegGetValueW(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
usedefault = FALSE;
|
||||||
|
ret = (size / sizeof(*buff)) - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WCHAR name[MAX_PATH];
|
||||||
|
DWORD index = 0;
|
||||||
|
DWORD namelen;
|
||||||
|
|
||||||
|
usedefault = FALSE;
|
||||||
|
|
||||||
|
memset(buff, 0, buff_len);
|
||||||
|
|
||||||
|
namelen = sizeof(name);
|
||||||
|
while (RegEnumValueW(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if ((ret + namelen+1) > buff_len)
|
||||||
|
break;
|
||||||
|
|
||||||
|
lstrcpyW(buff+ret, name);
|
||||||
|
ret += namelen+1;
|
||||||
|
namelen = sizeof(name);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(sectionkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
usedefault = entry != NULL;
|
||||||
|
|
||||||
|
if (usedefault)
|
||||||
|
{
|
||||||
|
lstrcpynW(buff, defvalue, buff_len);
|
||||||
|
ret = lstrlenW(buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WINAPI SQLGetPrivateProfileString(LPCSTR section, LPCSTR entry,
|
||||||
|
LPCSTR defvalue, LPSTR buff, int buff_len, LPCSTR filename)
|
||||||
|
{
|
||||||
|
WCHAR *sectionW, *filenameW;
|
||||||
|
BOOL usedefault = TRUE;
|
||||||
|
HKEY sectionkey;
|
||||||
|
LONG ret = 0;
|
||||||
|
|
||||||
|
TRACE("%s %s %s %p %d %s\n", debugstr_a(section), debugstr_a(entry),
|
||||||
|
debugstr_a(defvalue), buff, buff_len, debugstr_a(filename));
|
||||||
|
|
||||||
|
clear_errors();
|
||||||
|
|
||||||
|
if (buff_len <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (buff)
|
||||||
|
buff[0] = 0;
|
||||||
|
|
||||||
|
if (!section || !defvalue || !buff)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
sectionW = heap_strdupAtoW(section);
|
||||||
|
filenameW = heap_strdupAtoW(filename);
|
||||||
|
|
||||||
|
sectionkey = get_privateprofile_sectionkey(sectionW, filenameW);
|
||||||
|
|
||||||
|
heap_free(sectionW);
|
||||||
|
heap_free(filenameW);
|
||||||
|
|
||||||
|
if (sectionkey)
|
||||||
|
{
|
||||||
|
DWORD type, size;
|
||||||
|
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
size = buff_len * sizeof(*buff);
|
||||||
|
if (RegGetValueA(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
usedefault = FALSE;
|
||||||
|
ret = (size / sizeof(*buff)) - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char name[MAX_PATH] = {0};
|
||||||
|
DWORD index = 0;
|
||||||
|
DWORD namelen;
|
||||||
|
|
||||||
|
usedefault = FALSE;
|
||||||
|
|
||||||
|
memset(buff, 0, buff_len);
|
||||||
|
|
||||||
|
namelen = sizeof(name);
|
||||||
|
while (RegEnumValueA(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if ((ret + namelen+1) > buff_len)
|
||||||
|
break;
|
||||||
|
|
||||||
|
lstrcpyA(buff+ret, name);
|
||||||
|
|
||||||
|
ret += namelen+1;
|
||||||
|
namelen = sizeof(name);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(sectionkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
usedefault = entry != NULL;
|
||||||
|
|
||||||
|
if (usedefault)
|
||||||
|
{
|
||||||
|
lstrcpynA(buff, defvalue, buff_len);
|
||||||
|
ret = strlen(buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI SQLGetTranslatorW(HWND hwndParent, LPWSTR lpszName, WORD cbNameMax,
|
BOOL WINAPI SQLGetTranslatorW(HWND hwndParent, LPWSTR lpszName, WORD cbNameMax,
|
||||||
|
@ -1019,7 +1167,6 @@ BOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry
|
||||||
{
|
{
|
||||||
LONG ret;
|
LONG ret;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
WCHAR softwareodbc[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C',0};
|
|
||||||
|
|
||||||
clear_errors();
|
clear_errors();
|
||||||
TRACE("%s %s %s %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry),
|
TRACE("%s %s %s %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry),
|
||||||
|
@ -1031,7 +1178,7 @@ BOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = RegCreateKeyW(HKEY_CURRENT_USER, softwareodbc, &hkey)) == ERROR_SUCCESS)
|
if ((ret = RegCreateKeyW(HKEY_CURRENT_USER, odbcW, &hkey)) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
HKEY hkeyfilename;
|
HKEY hkeyfilename;
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ reactos/dll/win32/ntdsapi # Synced to WineStaging-1.7.55
|
||||||
reactos/dll/win32/ntprint # Synced to WineStaging-1.7.47
|
reactos/dll/win32/ntprint # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/objsel # Synced to WineStaging-1.7.47
|
reactos/dll/win32/objsel # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/odbc32 # Synced to WineStaging-1.7.37. Depends on port of Linux ODBC.
|
reactos/dll/win32/odbc32 # Synced to WineStaging-1.7.37. Depends on port of Linux ODBC.
|
||||||
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.47
|
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.55
|
||||||
reactos/dll/win32/ole32 # Synced to WineStaging-1.7.55
|
reactos/dll/win32/ole32 # Synced to WineStaging-1.7.55
|
||||||
reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47
|
reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.55
|
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.55
|
||||||
|
|
Loading…
Reference in a new issue