mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
fixed all my bugs passing PUNICODE_STRING objects as PWSTR. Fixed signature of RtlMultiByteToUnicodeN.
svn path=/trunk/; revision=5314
This commit is contained in:
parent
ef3c8f80d8
commit
d72f016227
3 changed files with 216 additions and 258 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rtl.h,v 1.13 2003/07/12 10:24:45 chorns Exp $
|
/* $Id: rtl.h,v 1.14 2003/07/29 16:44:48 royce Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1434,7 +1434,7 @@ RtlMultiByteToUnicodeN (
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
ULONG UnicodeSize,
|
ULONG UnicodeSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PCHAR MbString,
|
const PCHAR MbString,
|
||||||
ULONG MbSize
|
ULONG MbSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubsa.c,v 1.19 2003/07/28 19:38:58 royce Exp $
|
/* $Id: stubsa.c,v 1.20 2003/07/29 16:44:48 royce Exp $
|
||||||
*
|
*
|
||||||
* reactos/lib/gdi32/misc/stubs.c
|
* reactos/lib/gdi32/misc/stubs.c
|
||||||
*
|
*
|
||||||
|
@ -21,6 +21,29 @@
|
||||||
#include <rosrtl/devmode.h>
|
#include <rosrtl/devmode.h>
|
||||||
#include <rosrtl/logfont.h>
|
#include <rosrtl/logfont.h>
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STATIC
|
||||||
|
HEAP_strdupA2W ( HANDLE hHeap, LPWSTR* ppszW, LPCSTR lpszA )
|
||||||
|
{
|
||||||
|
ULONG len;
|
||||||
|
*ppszW = NULL;
|
||||||
|
if ( !lpszA )
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
len = lstrlenA(lpszA);
|
||||||
|
*ppszW = RtlAllocateHeap ( hHeap, 0, (len+1) * sizeof(WCHAR) );
|
||||||
|
if ( !*ppszW )
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
return RtlMultiByteToUnicodeN ( *ppszW, len, NULL, (PCHAR)lpszA, len );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STATIC HEAP_free ( HANDLE hHeap, LPVOID memory )
|
||||||
|
{
|
||||||
|
RtlFreeHeap ( hHeap, 0, memory );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -29,21 +52,19 @@ STDCALL
|
||||||
AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
|
AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FilenameU;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
int rc;
|
PWSTR FilenameW;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FilenameU,
|
Status = HEAP_strdupA2W ( hHeap, &FilenameW, lpszFilename );
|
||||||
(PCSZ)lpszFilename );
|
if ( !NT_SUCCESS (Status) )
|
||||||
if (!NT_SUCCESS (Status))
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = AddFontResourceExW ( FilenameW, fl, pvReserved );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, &FilenameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = AddFontResourceExW ( FilenameU.Buffer, fl, pvReserved );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &FilenameU );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,20 +90,19 @@ CopyMetaFileA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FileU;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
HMETAFILE rc;
|
PWSTR lpszFileW;
|
||||||
|
HMETAFILE rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FileU,
|
Status = HEAP_strdupA2W ( hHeap, &lpszFileW, lpszFile );
|
||||||
(PCSZ)lpszFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
else
|
||||||
return 0;
|
{
|
||||||
}
|
rc = W32kCopyMetaFile ( Src, lpszFileW );
|
||||||
|
|
||||||
rc = W32kCopyMetaFile ( Src, FileU.Buffer );
|
HEAP_free ( hHeap, lpszFileW );
|
||||||
|
}
|
||||||
RtlFreeUnicodeString ( &FileU );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -101,46 +121,40 @@ CreateICA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING Driver, Device, Output;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
|
LPWSTR lpszDriverW, lpszDeviceW, lpszOutputW;
|
||||||
DEVMODEW dvmInitW;
|
DEVMODEW dvmInitW;
|
||||||
HDC rc;
|
HDC rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Driver,
|
Status = HEAP_strdupA2W ( hHeap, &lpszDriverW, lpszDriver );
|
||||||
(PCSZ)lpszDriver );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = HEAP_strdupA2W ( hHeap, &lpszDeviceW, lpszDevice );
|
||||||
|
if (!NT_SUCCESS (Status))
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
return 0;
|
else
|
||||||
}
|
{
|
||||||
|
Status = HEAP_strdupA2W ( hHeap, &lpszOutputW, lpszOutput );
|
||||||
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( lpdvmInit )
|
||||||
|
RosRtlDevModeA2W ( &dvmInitW, (const LPDEVMODEA)lpdvmInit );
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Device,
|
rc = W32kCreateIC ( lpszDriverW,
|
||||||
(PCSZ)lpszDevice );
|
lpszDeviceW,
|
||||||
if (!NT_SUCCESS (Status))
|
lpszOutputW,
|
||||||
{
|
lpdvmInit ? &dvmInitW : NULL );
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Output,
|
|
||||||
(PCSZ)lpszOutput );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( lpdvmInit )
|
|
||||||
RosRtlDevModeA2W ( &dvmInitW, (const LPDEVMODEA)lpdvmInit );
|
|
||||||
|
|
||||||
rc = W32kCreateIC ( Driver.Buffer,
|
|
||||||
Device.Buffer,
|
|
||||||
Output.Buffer,
|
|
||||||
lpdvmInit ? &dvmInitW : NULL );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &Output );
|
|
||||||
RtlFreeUnicodeString ( &Device );
|
|
||||||
RtlFreeUnicodeString ( &Driver );
|
|
||||||
|
|
||||||
|
HEAP_free ( hHeap, lpszOutputW );
|
||||||
|
}
|
||||||
|
HEAP_free ( hHeap, lpszDeviceW );
|
||||||
|
}
|
||||||
|
HEAP_free ( hHeap, lpszDriverW );
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,22 +168,20 @@ CreateMetaFileA(
|
||||||
LPCSTR lpszFile
|
LPCSTR lpszFile
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
HDC rc;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING File;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
|
PWSTR lpszFileW;
|
||||||
|
HDC rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &File,
|
Status = HEAP_strdupA2W ( hHeap, &lpszFileW, lpszFile );
|
||||||
(PCSZ)lpszFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kCreateMetaFile ( lpszFileW );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpszFileW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kCreateMetaFile ( File.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &File );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,42 +199,38 @@ CreateScalableFontResourceA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FontRes, FontFile, CurrentPath;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
BOOL rc;
|
LPWSTR lpszFontResW, lpszFontFileW, lpszCurrentPathW;
|
||||||
|
BOOL rc = FALSE;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FontRes,
|
Status = HEAP_strdupA2W ( hHeap, &lpszFontResW, lpszFontRes );
|
||||||
(PCSZ)lpszFontRes );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
Status = HEAP_strdupA2W ( hHeap, &lpszFontFileW, lpszFontFile );
|
||||||
return 0;
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = HEAP_strdupA2W ( hHeap, &lpszCurrentPathW, lpszCurrentPath );
|
||||||
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rc = W32kCreateScalableFontResource ( fdwHidden,
|
||||||
|
lpszFontResW,
|
||||||
|
lpszFontFileW,
|
||||||
|
lpszCurrentPathW );
|
||||||
|
|
||||||
|
HEAP_free ( hHeap, lpszCurrentPathW );
|
||||||
|
}
|
||||||
|
|
||||||
|
HEAP_free ( hHeap, lpszFontFileW );
|
||||||
|
}
|
||||||
|
|
||||||
|
HEAP_free ( hHeap, lpszFontResW );
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FontFile,
|
|
||||||
(PCSZ)lpszFontFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &CurrentPath,
|
|
||||||
(PCSZ)lpszCurrentPath );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return W32kCreateScalableFontResource ( fdwHidden,
|
|
||||||
FontRes.Buffer,
|
|
||||||
FontFile.Buffer,
|
|
||||||
CurrentPath.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &FontRes );
|
|
||||||
RtlFreeUnicodeString ( &FontFile );
|
|
||||||
RtlFreeUnicodeString ( &CurrentPath );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,55 +248,8 @@ DeviceCapabilitiesExA(
|
||||||
CONST DEVMODEA *pDevMode
|
CONST DEVMODEA *pDevMode
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
NTSTATUS Status;
|
|
||||||
UNICODE_STRING Device, Port, Output;
|
|
||||||
DEVMODEW DevModeW;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Device,
|
|
||||||
(PCSZ)pDevice );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Port,
|
|
||||||
(PCSZ)pPort );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Output,
|
|
||||||
(PCSZ)pOutput );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pDevMode )
|
|
||||||
RosRtlDevModeA2W ( &DevModeW, (const LPDEVMODEA)pDevMode );
|
|
||||||
|
|
||||||
/* FIXME no W32kDeviceCapabilities???? */
|
|
||||||
rc = W32kDeviceCapabilities ( Device.Buffer,
|
|
||||||
Port.Buffer,
|
|
||||||
fwCapability
|
|
||||||
Output.Buffer,
|
|
||||||
pDevMode ? &DevModeW : NULL );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &Device );
|
|
||||||
RtlFreeUnicodeString ( &Port );
|
|
||||||
RtlFreeUnicodeString ( &Output );
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
#else
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,21 +288,20 @@ EnumFontFamiliesA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING Family;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
int rc;
|
LPWSTR lpszFamilyW;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Family,
|
Status = HEAP_strdupA2W ( hHeap, &lpszFamilyW, lpszFamily );
|
||||||
(PCSZ)lpszFamily );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kEnumFontFamilies ( hdc, lpszFamilyW, lpEnumFontFamProc, lParam );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpszFamilyW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kEnumFontFamilies ( hdc, Family.Buffer, lpEnumFontFamProc, lParam );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &Family );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,27 +319,25 @@ EnumFontsA (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FaceName;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
int rc;
|
LPWSTR lpFaceNameW;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FaceName,
|
Status = HEAP_strdupA2W ( hHeap, &lpFaceNameW, lpFaceName );
|
||||||
(PCSZ)lpFaceName );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kEnumFonts ( hDC, lpFaceNameW, FontFunc, lParam );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpFaceNameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kEnumFonts ( hDC, FaceName.Buffer, FontFunc, lParam );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &FaceName );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -390,12 +348,13 @@ GetCharWidthA (
|
||||||
LPINT lpBuffer
|
LPINT lpBuffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
return W32kGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
|
return W32kGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -406,12 +365,13 @@ GetCharWidth32A(
|
||||||
LPINT lpBuffer
|
LPINT lpBuffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
return W32kGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
return W32kGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -422,12 +382,13 @@ GetCharWidthFloatA(
|
||||||
PFLOAT pxBuffer
|
PFLOAT pxBuffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
return W32kGetCharWidthFloat ( hdc, iFirstChar, iLastChar, pxBuffer );
|
return W32kGetCharWidthFloat ( hdc, iFirstChar, iLastChar, pxBuffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -438,12 +399,13 @@ GetCharABCWidthsA(
|
||||||
LPABC lpabc
|
LPABC lpabc
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
/* FIXME what to do with uFirstChar and uLastChar ??? */
|
||||||
return W32kGetCharABCWidths ( hdc, uFirstChar, uLastChar, lpabc );
|
return W32kGetCharABCWidths ( hdc, uFirstChar, uLastChar, lpabc );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -454,6 +416,7 @@ GetCharABCWidthsFloatA(
|
||||||
LPABCFLOAT lpABCF
|
LPABCFLOAT lpABCF
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
return W32kGetCharABCWidthsFloat ( hdc, iFirstChar, iLastChar, lpABCF );
|
return W32kGetCharABCWidthsFloat ( hdc, iFirstChar, iLastChar, lpABCF );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,21 +450,20 @@ GetMetaFileA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING MetaFile;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
HMETAFILE rc;
|
LPWSTR lpszMetaFileW;
|
||||||
|
HMETAFILE rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &MetaFile,
|
Status = HEAP_strdupA2W ( hHeap, &lpszMetaFileW, lpszMetaFile );
|
||||||
(PCSZ)lpszMetaFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kGetMetaFile ( lpszMetaFileW );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpszMetaFileW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kGetMetaFile ( MetaFile.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &MetaFile );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,7 +485,7 @@ GetOutlineTextMetricsA(
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -538,21 +500,20 @@ GetTextExtentExPointA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING Str;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
BOOL rc;
|
LPWSTR lpszStrW;
|
||||||
|
BOOL rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Str,
|
Status = HEAP_strdupA2W ( hHeap, &lpszStrW, lpszStr );
|
||||||
(PCSZ)lpszStr );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
else
|
||||||
return 0;
|
{
|
||||||
}
|
rc = W32kGetTextExtentExPoint (
|
||||||
|
hdc, lpszStrW, cchString, nMaxExtent, lpnFit, alpDx, lpSize );
|
||||||
|
|
||||||
rc = W32kGetTextExtentExPoint (
|
HEAP_free ( hHeap, lpszStrW );
|
||||||
hdc, Str.Buffer, cchString, nMaxExtent, lpnFit, alpDx, lpSize );
|
}
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &Str );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -605,21 +566,20 @@ RemoveFontResourceA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FileName;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
BOOL rc;
|
LPWSTR lpFileNameW;
|
||||||
|
BOOL rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FileName,
|
Status = HEAP_strdupA2W ( hHeap, &lpFileNameW, lpFileName );
|
||||||
(PCSZ)lpFileName );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kRemoveFontResource ( lpFileNameW );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpFileNameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kRemoveFontResource ( FileName.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &FileName );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,21 +595,19 @@ CopyEnhMetaFileA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING File;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
HENHMETAFILE rc;
|
LPWSTR lpszFileW;
|
||||||
|
HENHMETAFILE rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &File,
|
Status = HEAP_strdupA2W ( hHeap, &lpszFileW, lpszFile );
|
||||||
(PCSZ)lpszFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
rc = W32kCopyEnhMetaFile ( hemfSrc, lpszFileW );
|
||||||
return 0;
|
|
||||||
|
HEAP_free ( hHeap, lpszFileW );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = W32kCopyEnhMetaFile ( hemfSrc, File.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &File );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,30 +625,28 @@ CreateEnhMetaFileA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING FileName, Description;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
HDC rc;
|
LPWSTR lpFileNameW, lpDescriptionW;
|
||||||
|
HDC rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &FileName,
|
Status = HEAP_strdupA2W ( hHeap, &lpFileNameW, lpFileName );
|
||||||
(PCSZ)lpFileName );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
Status = HEAP_strdupA2W ( hHeap, &lpDescriptionW, lpDescription );
|
||||||
return 0;
|
if (!NT_SUCCESS (Status))
|
||||||
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rc = W32kCreateEnhMetaFile (
|
||||||
|
hdc, lpFileNameW, (CONST LPRECT)lpRect, lpDescriptionW );
|
||||||
|
|
||||||
|
HEAP_free ( hHeap, lpDescriptionW );
|
||||||
|
}
|
||||||
|
HEAP_free ( hHeap, lpFileNameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &Description,
|
|
||||||
(PCSZ)lpDescription );
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = W32kCreateEnhMetaFile ( hdc, FileName.Buffer, (CONST LPRECT)lpRect, Description.Buffer );
|
|
||||||
|
|
||||||
RtlFreeUnicodeString ( &FileName );
|
|
||||||
RtlFreeUnicodeString ( &Description );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -705,20 +661,19 @@ GetEnhMetaFileA(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING MetaFile;
|
HANDLE hHeap = RtlGetProcessHeap();
|
||||||
HENHMETAFILE rc;
|
LPWSTR lpszMetaFileW;
|
||||||
|
HENHMETAFILE rc = 0;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz ( &MetaFile,
|
Status = HEAP_strdupA2W ( hHeap, &lpszMetaFileW, lpszMetaFile );
|
||||||
(PCSZ)lpszMetaFile );
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
else
|
||||||
return 0;
|
{
|
||||||
}
|
rc = W32kGetEnhMetaFile ( lpszMetaFileW );
|
||||||
|
|
||||||
rc = W32kGetEnhMetaFile ( MetaFile.Buffer );
|
HEAP_free ( hHeap, lpszMetaFileW );
|
||||||
|
}
|
||||||
RtlFreeUnicodeString ( &MetaFile );
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -737,14 +692,21 @@ GetEnhMetaFileDescriptionA(
|
||||||
{
|
{
|
||||||
HANDLE hHeap;
|
HANDLE hHeap;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
LPWSTR lpszDescriptionW = NULL;
|
LPWSTR lpszDescriptionW;
|
||||||
UINT rc;
|
UINT rc;
|
||||||
|
|
||||||
if ( lpszDescription && cchBuffer )
|
if ( lpszDescription && cchBuffer )
|
||||||
{
|
{
|
||||||
hHeap = RtlGetProcessHeap();
|
hHeap = RtlGetProcessHeap();
|
||||||
lpszDescriptionW = (LPWSTR)RtlAllocateHeap ( hHeap, 0, cchBuffer*sizeof(WCHAR) );
|
lpszDescriptionW = (LPWSTR)RtlAllocateHeap ( hHeap, 0, cchBuffer*sizeof(WCHAR) );
|
||||||
|
if ( !lpszDescriptionW )
|
||||||
|
{
|
||||||
|
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lpszDescriptionW = NULL;
|
||||||
|
|
||||||
rc = W32kGetEnhMetaFileDescription ( hemf, cchBuffer, lpszDescriptionW );
|
rc = W32kGetEnhMetaFileDescription ( hemf, cchBuffer, lpszDescriptionW );
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: nls.c,v 1.18 2003/07/21 21:53:53 royce Exp $
|
/* $Id: nls.c,v 1.19 2003/07/29 16:44:48 royce Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -358,7 +358,7 @@ NTSTATUS STDCALL
|
||||||
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
ULONG UnicodeSize,
|
ULONG UnicodeSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PCHAR MbString,
|
const PCHAR MbString,
|
||||||
ULONG MbSize)
|
ULONG MbSize)
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
|
@ -376,11 +376,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
*ResultSize = Size * sizeof(WCHAR);
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
UnicodeString[i] = NlsAnsiToUnicodeTable[(unsigned int)MbString[i]];
|
||||||
*UnicodeString = NlsAnsiToUnicodeTable[(unsigned int)*MbString];
|
|
||||||
UnicodeString++;
|
|
||||||
MbString++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue