mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fix W->A conversions in EnumDisplaySettingsExA. This is dedicated to Caroline!
svn path=/trunk/; revision=13802
This commit is contained in:
parent
e5948313f6
commit
113ecdfc88
1 changed files with 16 additions and 6 deletions
|
@ -200,6 +200,15 @@ EnumDisplaySettingsExA(
|
||||||
{
|
{
|
||||||
BOOL rc;
|
BOOL rc;
|
||||||
UNICODE_STRING DeviceName;
|
UNICODE_STRING DeviceName;
|
||||||
|
LPDEVMODEW lpDevModeW;
|
||||||
|
|
||||||
|
lpDevModeW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(DEVMODEW) + lpDevMode->dmDriverExtra);
|
||||||
|
if ( lpDevModeW == NULL )
|
||||||
|
{
|
||||||
|
SetLastError ( ERROR_OUTOFMEMORY );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
|
if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
|
||||||
{
|
{
|
||||||
|
@ -207,15 +216,16 @@ EnumDisplaySettingsExA(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
lpDevModeW->dmSize = sizeof(DEVMODEW);
|
||||||
* NOTE: We don't need to convert between DEVMODEW and DEVMODEA because
|
lpDevModeW->dmDriverExtra = 0;
|
||||||
* only dmBitsPerPel, dmPelsWidth, dmPelsHeight, dmDisplayFlags and
|
|
||||||
* dmDisplayFrequency fields are set.
|
rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, lpDevModeW,
|
||||||
*/
|
|
||||||
rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, (LPDEVMODEW)lpDevMode,
|
|
||||||
dwFlags );
|
dwFlags );
|
||||||
|
|
||||||
|
RosRtlDevModeW2A ( lpDevMode, lpDevModeW );
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &DeviceName );
|
RtlFreeUnicodeString ( &DeviceName );
|
||||||
|
HeapFree ( GetProcessHeap(), 0, lpDevModeW );
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue