mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
[KERNEL32]
reduce diff to wine svn path=/trunk/; revision=46229
This commit is contained in:
parent
bdbfaa6b19
commit
251f0e96d8
2 changed files with 28 additions and 48 deletions
|
@ -993,7 +993,7 @@ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len )
|
|||
*
|
||||
*/
|
||||
static INT PROFILE_GetString( LPCWSTR section, LPCWSTR key_name,
|
||||
LPCWSTR def_val, LPWSTR buffer, UINT len, BOOL win32 )
|
||||
LPCWSTR def_val, LPWSTR buffer, UINT len )
|
||||
{
|
||||
PROFILEKEY *key = NULL;
|
||||
static const WCHAR empty_strW[] = { 0 };
|
||||
|
@ -1114,16 +1114,12 @@ UINT WINAPI GetProfileIntW( LPCWSTR section, LPCWSTR entry, INT def_val )
|
|||
return GetPrivateProfileIntW( section, entry, def_val, L"win.ini" );
|
||||
}
|
||||
|
||||
/*
|
||||
* if win32, copy:
|
||||
* - Section names if 'section' is NULL
|
||||
* - Keys in a Section if 'entry' is NULL
|
||||
* (see MSDN doc for GetPrivateProfileString)
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileStringW (KERNEL32.@)
|
||||
*/
|
||||
static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
|
||||
LPCWSTR def_val, LPWSTR buffer,
|
||||
UINT len, LPCWSTR filename,
|
||||
BOOL win32 )
|
||||
DWORD WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
|
||||
LPCWSTR def_val, LPWSTR buffer,
|
||||
DWORD len, LPCWSTR filename )
|
||||
{
|
||||
int ret;
|
||||
LPWSTR defval_tmp = NULL;
|
||||
|
@ -1141,30 +1137,30 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
|
|||
|
||||
if (p >= def_val)
|
||||
{
|
||||
int len = (int)(p - def_val) + 1;
|
||||
int len = (int)(p - def_val) + 1;
|
||||
|
||||
defval_tmp = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
|
||||
if (!defval_tmp) return 0;
|
||||
memcpy(defval_tmp, def_val, len * sizeof(WCHAR));
|
||||
defval_tmp[len] = '\0';
|
||||
def_val = defval_tmp;
|
||||
defval_tmp = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
|
||||
if (!defval_tmp) return 0;
|
||||
memcpy(defval_tmp, def_val, len * sizeof(WCHAR));
|
||||
defval_tmp[len] = '\0';
|
||||
def_val = defval_tmp;
|
||||
}
|
||||
}
|
||||
|
||||
RtlEnterCriticalSection( &PROFILE_CritSect );
|
||||
|
||||
if (PROFILE_Open( filename, FALSE )) {
|
||||
if (win32 && (section == NULL))
|
||||
if (section == NULL)
|
||||
ret = PROFILE_GetSectionNames(buffer, len);
|
||||
else
|
||||
/* PROFILE_GetString can handle the 'entry == NULL' case */
|
||||
ret = PROFILE_GetString( section, entry, def_val, buffer, len, win32 );
|
||||
ret = PROFILE_GetString( section, entry, def_val, buffer, len );
|
||||
} else if (buffer && def_val) {
|
||||
lstrcpynW( buffer, def_val, len );
|
||||
ret = wcslen( buffer );
|
||||
}
|
||||
else
|
||||
ret = 0;
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
RtlLeaveCriticalSection( &PROFILE_CritSect );
|
||||
|
||||
|
@ -1175,7 +1171,6 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileStringA (KERNEL32.@)
|
||||
*/
|
||||
|
@ -1219,21 +1214,6 @@ DWORD WINAPI GetPrivateProfileStringA( LPCSTR section, LPCSTR entry,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileStringW (KERNEL32.@)
|
||||
*/
|
||||
DWORD WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
|
||||
LPCWSTR def_val, LPWSTR buffer,
|
||||
DWORD len, LPCWSTR filename )
|
||||
{
|
||||
DPRINT("(%S, %S, %S, %p, %d, %S)\n",
|
||||
section, entry, def_val, buffer, len, filename);
|
||||
|
||||
return PROFILE_GetPrivateProfileString( section, entry, def_val,
|
||||
buffer, len, filename, TRUE );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetProfileStringA (KERNEL32.@)
|
||||
*/
|
||||
|
@ -1244,7 +1224,6 @@ DWORD WINAPI GetProfileStringA( LPCSTR section, LPCSTR entry, LPCSTR def_val,
|
|||
buffer, len, "win.ini" );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetProfileStringW (KERNEL32.@)
|
||||
*/
|
||||
|
@ -1853,10 +1832,19 @@ WritePrivateProfileStructA (LPCSTR section, LPCSTR key,
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* CloseProfileUserMapping
|
||||
* OpenProfileUserMapping (KERNEL32.@)
|
||||
*/
|
||||
BOOL WINAPI
|
||||
CloseProfileUserMapping(VOID)
|
||||
BOOL WINAPI OpenProfileUserMapping(VOID)
|
||||
{
|
||||
DPRINT1("(), stub!\n");
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CloseProfileUserMapping (KERNEL32.@)
|
||||
*/
|
||||
BOOL WINAPI CloseProfileUserMapping(VOID)
|
||||
{
|
||||
DPRINT1("(), stub!\n");
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
|
|
|
@ -1156,14 +1156,6 @@ OpenDataFile(HANDLE hFile, DWORD dwUnused)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
OpenProfileUserMapping(VOID)
|
||||
{
|
||||
STUB;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
PrivMoveFileIdentityW(DWORD Unknown1, DWORD Unknown2, DWORD Unknown3)
|
||||
|
|
Loading…
Reference in a new issue