mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Kill large parts of rosrtl. devmode conversion implented in gdi32 because it's actually an exported api, 2nd converstion used only once so inlined. logfont conversion implented as functions directly in the ddl. rtlrosmin/max replaced by actual macros, and resource rtlros function in aclui replace by actual win32 call. other rosrtl code was already deprecated.
svn path=/trunk/; revision=16359
This commit is contained in:
parent
2125679164
commit
4eb4922aad
22 changed files with 289 additions and 271 deletions
|
@ -1,18 +0,0 @@
|
|||
/* devmode.h
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void
|
||||
RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA );
|
||||
void
|
||||
RosRtlDevModeW2A( LPDEVMODEA pA, const LPDEVMODEW pW );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* gdimacro.h
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_GDIMACRO_H
|
||||
#define ROSRTL_GDIMACRO_H
|
||||
|
||||
#define IN_RECT(r,x,y) \
|
||||
( \
|
||||
(x) >= (r).left && \
|
||||
(y) >= (r).top && \
|
||||
(x) < (r).right && \
|
||||
(y) < (r).bottom \
|
||||
)
|
||||
|
||||
#define RECT_OVERLAP(a,b) \
|
||||
( \
|
||||
(a).left < (b).right && \
|
||||
(b).left < (a).right && \
|
||||
(a).top < (b).bottom && \
|
||||
(b).top < (a).bottom \
|
||||
)
|
||||
|
||||
#endif /* ROSRTL_GDIMACRO_H */
|
|
@ -1,19 +0,0 @@
|
|||
/* logfont.h
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void
|
||||
RosRtlLogFontA2W ( LPLOGFONTW pW, const LOGFONTA *pA );
|
||||
|
||||
void
|
||||
RosRtlLogFontW2A ( LPLOGFONTA pA, const LOGFONTW *pW );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,23 +0,0 @@
|
|||
/* $Id$
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_MINMAX_H__
|
||||
#define ROSRTL_MINMAX_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define RtlRosMin(X,Y) (((X) < (Y))? (X) : (Y))
|
||||
#define RtlRosMax(X,Y) (((X) > (Y))? (X) : (Y))
|
||||
#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z))
|
||||
#define RtlRosMax3(X,Y,Z) (((X) > (Y)) ? RtlRosMax(X,Z) : RtlRosMax(Y,Z))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_PATH_H__
|
||||
#define ROSRTL_PATH_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
BOOL STDCALL MakeSureDirectoryPathExistsExA(LPCSTR DirPath, BOOL FileAtEnd);
|
||||
BOOL STDCALL MakeSureDirectoryPathExistsExW(LPCWSTR DirPath, BOOL FileAtEnd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,23 +0,0 @@
|
|||
/* $Id$
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_SEC_H__
|
||||
#define ROSRTL_SEC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
BOOL
|
||||
RosEnableThreadPrivileges(HANDLE *hToken, LUID *Privileges, DWORD PrivilegeCount);
|
||||
BOOL
|
||||
RosResetThreadPrivileges(HANDLE hToken);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,43 +0,0 @@
|
|||
/* $Id$
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_RESSTR_H__
|
||||
#define ROSRTL_RESSTR_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
int
|
||||
RosLenOfStrResource(HINSTANCE hInst, UINT uID);
|
||||
int
|
||||
RosAllocAndLoadStringA(LPSTR *lpTarget, HINSTANCE hInst, UINT uID);
|
||||
int
|
||||
RosAllocAndLoadStringW(LPWSTR *lpTarget, HINSTANCE hInst, UINT uID);
|
||||
DWORD
|
||||
RosFormatStrA(LPSTR *lpTarget, LPSTR lpFormat, ...);
|
||||
DWORD
|
||||
RosFormatStrW(LPWSTR *lpTarget, LPWSTR lpFormat, ...);
|
||||
DWORD
|
||||
RosLoadAndFormatStrA(HINSTANCE hInst, UINT uID, LPSTR *lpTarget, ...);
|
||||
DWORD
|
||||
RosLoadAndFormatStrW(HINSTANCE hInst, UINT uID, LPWSTR *lpTarget, ...);
|
||||
|
||||
#ifdef UNICODE
|
||||
# define RosFmtString RosFmtStringW
|
||||
# define RosAllocAndLoadString RosAllocAndLoadStringW
|
||||
# define RosLoadAndFormatStr RosLoadAndFormatStrW
|
||||
#else
|
||||
# define RosFmtString RosFmtStringA
|
||||
# define RosAllocAndLoadString RosAllocAndLoadStringA
|
||||
# define RosLoadAndFormatStr RosLoadAndFormatStrA
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -1,36 +0,0 @@
|
|||
/* $Id$
|
||||
*/
|
||||
|
||||
#ifndef ROSRTL_SPARSE_H__
|
||||
#define ROSRTL_SPARSE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
SetFileSparse(HANDLE hFile);
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
ZeroFileData(HANDLE hFile,
|
||||
PLARGE_INTEGER pliFileOffset,
|
||||
PLARGE_INTEGER pliBeyondFinalZero);
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
QueryAllocatedFileRanges(HANDLE hFile,
|
||||
PLARGE_INTEGER pliFileOffset,
|
||||
PLARGE_INTEGER pliLength,
|
||||
PFILE_ALLOCATED_RANGE_BUFFER lpAllocatedRanges,
|
||||
DWORD dwBufferSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
|
@ -31,7 +31,6 @@
|
|||
#include <commctrl.h>
|
||||
#include <prsht.h>
|
||||
#include <aclui.h>
|
||||
#include <rosrtl/resstr.h>
|
||||
#include "internal.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
@ -184,7 +183,7 @@ EditSecurity(HWND hwndOwner, LPSECURITYINFO psi)
|
|||
SI_OBJECT_INFO ObjectInfo;
|
||||
PROPSHEETHEADER psh;
|
||||
HPROPSHEETPAGE hPages[1];
|
||||
LPWSTR lpCaption;
|
||||
LPVOID lpCaption;
|
||||
BOOL Ret;
|
||||
|
||||
if(psi == NULL)
|
||||
|
@ -229,8 +228,15 @@ EditSecurity(HWND hwndOwner, LPSECURITYINFO psi)
|
|||
{
|
||||
/* Set the page title to the object name, make sure the format string
|
||||
has "%1" NOT "%s" because it uses FormatMessage() to automatically
|
||||
allocate the right amount of memory. */
|
||||
RosLoadAndFormatStr(hDllInstance, IDS_PSP_TITLE, &lpCaption, ObjectInfo.pszObjectName);
|
||||
allocate the right amount of memory. */
|
||||
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||
hDllInstance,
|
||||
IDS_PSP_TITLE,
|
||||
0,
|
||||
(LPSTR)lpCaption,
|
||||
0,
|
||||
(va_list*)&ObjectInfo.pszObjectName); /* Acc. to MSDN, should work */
|
||||
psh.pszCaption = lpCaption;
|
||||
}
|
||||
psh.nPages = sizeof(hPages) / sizeof(HPROPSHEETPAGE);
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
/* Win32K External Headers */
|
||||
#include <win32k/kapi.h>
|
||||
|
||||
/* FIXME: ROSRTL */
|
||||
#include <rosrtl/logfont.h>
|
||||
#include <rosrtl/devmode.h>
|
||||
|
||||
#define NtUserGetDCBrushColor(hbr) \
|
||||
(COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)
|
||||
|
||||
|
@ -73,4 +69,16 @@ BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, PVOID *UserData);
|
|||
BOOL STDCALL CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize);
|
||||
LPBITMAPINFO STDCALL ConvertBitmapInfo(CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData);
|
||||
|
||||
/* == CONVERSION FUNCTIONS ================================================== */
|
||||
DEVMODEW *
|
||||
STDCALL
|
||||
GdiConvertToDevmodeW(DEVMODEA *dm);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW);
|
||||
/* EOF */
|
||||
|
|
|
@ -11,12 +11,15 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
#define SIZEOF_DEVMODEA_300 124
|
||||
#define SIZEOF_DEVMODEA_400 148
|
||||
#define SIZEOF_DEVMODEA_500 156
|
||||
#define SIZEOF_DEVMODEW_300 188
|
||||
#define SIZEOF_DEVMODEW_400 212
|
||||
#define SIZEOF_DEVMODEW_500 220
|
||||
|
||||
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -2676,15 +2679,74 @@ GdiConvertMetaFilePict(HGLOBAL hMem)
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
DEVMODEW *
|
||||
STDCALL
|
||||
GdiConvertToDevmodeW(DEVMODEA *dm)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
LPDEVMODEW dmw;
|
||||
|
||||
dmw = HEAP_alloc(sizeof(DEVMODEW));
|
||||
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, (LPSTR)dm->f, len, dmw->f, len )
|
||||
#define COPYN(f) dmw->f = dm->f
|
||||
COPYS(dmDeviceName, CCHDEVICENAME );
|
||||
COPYN(dmSpecVersion);
|
||||
COPYN(dmDriverVersion);
|
||||
switch ( dm->dmSize )
|
||||
{
|
||||
case SIZEOF_DEVMODEA_300:
|
||||
dmw->dmSize = SIZEOF_DEVMODEW_300;
|
||||
break;
|
||||
case SIZEOF_DEVMODEA_400:
|
||||
dmw->dmSize = SIZEOF_DEVMODEW_400;
|
||||
break;
|
||||
case SIZEOF_DEVMODEA_500:
|
||||
default: /* FIXME what to do??? */
|
||||
dmw->dmSize = SIZEOF_DEVMODEW_500;
|
||||
break;
|
||||
}
|
||||
COPYN(dmDriverExtra);
|
||||
COPYN(dmFields);
|
||||
COPYN(dmPosition.x);
|
||||
COPYN(dmPosition.y);
|
||||
COPYN(dmScale);
|
||||
COPYN(dmCopies);
|
||||
COPYN(dmDefaultSource);
|
||||
COPYN(dmPrintQuality);
|
||||
COPYN(dmColor);
|
||||
COPYN(dmDuplex);
|
||||
COPYN(dmYResolution);
|
||||
COPYN(dmTTOption);
|
||||
COPYN(dmCollate);
|
||||
COPYS(dmFormName,CCHFORMNAME);
|
||||
COPYN(dmLogPixels);
|
||||
COPYN(dmBitsPerPel);
|
||||
COPYN(dmPelsWidth);
|
||||
COPYN(dmPelsHeight);
|
||||
COPYN(dmDisplayFlags); // aka dmNup
|
||||
COPYN(dmDisplayFrequency);
|
||||
|
||||
if ( dm->dmSize <= SIZEOF_DEVMODEA_300 )
|
||||
return dmw; // we're done with 0x300 fields
|
||||
|
||||
COPYN(dmICMMethod);
|
||||
COPYN(dmICMIntent);
|
||||
COPYN(dmMediaType);
|
||||
COPYN(dmDitherType);
|
||||
COPYN(dmReserved1);
|
||||
COPYN(dmReserved2);
|
||||
|
||||
if ( dm->dmSize <= SIZEOF_DEVMODEA_400 )
|
||||
return dmw; // we're done with 0x400 fields
|
||||
|
||||
COPYN(dmPanningWidth);
|
||||
COPYN(dmPanningHeight);
|
||||
|
||||
return dmw;
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -147,7 +147,7 @@ CreateICA(
|
|||
NTSTATUS Status;
|
||||
LPWSTR lpszDriverW, lpszDeviceW, lpszOutputW;
|
||||
UNICODE_STRING Driver, Device, Output;
|
||||
DEVMODEW dvmInitW;
|
||||
LPDEVMODEW dvmInitW;
|
||||
HDC rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszDriverW, lpszDriver );
|
||||
|
@ -166,7 +166,7 @@ CreateICA(
|
|||
else
|
||||
{
|
||||
if ( lpdvmInit )
|
||||
RosRtlDevModeA2W ( &dvmInitW, (const LPDEVMODEA)lpdvmInit );
|
||||
dvmInitW = GdiConvertToDevmodeW((LPDEVMODEA)lpdvmInit);
|
||||
|
||||
RtlInitUnicodeString(&Driver, lpszDriverW);
|
||||
RtlInitUnicodeString(&Device, lpszDeviceW);
|
||||
|
@ -174,8 +174,8 @@ CreateICA(
|
|||
rc = NtGdiCreateIC ( &Driver,
|
||||
&Device,
|
||||
&Output,
|
||||
lpdvmInit ? &dvmInitW : NULL );
|
||||
|
||||
lpdvmInit ? dvmInitW : NULL );
|
||||
HEAP_free (dvmInitW);
|
||||
HEAP_free ( lpszOutputW );
|
||||
}
|
||||
HEAP_free ( lpszDeviceW );
|
||||
|
@ -264,7 +264,7 @@ GetObjectA(HGDIOBJ Handle, int Size, LPVOID Buffer)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
RosRtlLogFontW2A((LPLOGFONTA) Buffer, &LogFontW);
|
||||
LogFontW2A((LPLOGFONTA) Buffer, &LogFontW);
|
||||
Result = sizeof(LOGFONTA);
|
||||
}
|
||||
else
|
||||
|
@ -362,11 +362,14 @@ ResetDCA(
|
|||
CONST DEVMODEA *lpInitData
|
||||
)
|
||||
{
|
||||
DEVMODEW InitDataW;
|
||||
LPDEVMODEW InitDataW;
|
||||
HDC hDc;
|
||||
|
||||
RosRtlDevModeA2W ( &InitDataW, (CONST LPDEVMODEA)lpInitData );
|
||||
InitDataW = GdiConvertToDevmodeW((LPDEVMODEA)lpInitData);
|
||||
|
||||
return NtGdiResetDC ( hdc, &InitDataW );
|
||||
hDc = NtGdiResetDC ( hdc, InitDataW );
|
||||
HEAP_free(InitDataW);
|
||||
return hDc;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ IntEnumFontFamilies(HDC Dc, LPLOGFONTW LogFont, PVOID EnumProc, LPARAM lParam,
|
|||
}
|
||||
else
|
||||
{
|
||||
RosRtlLogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont);
|
||||
LogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont);
|
||||
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfFullName, -1,
|
||||
(LPSTR)EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL);
|
||||
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfStyle, -1,
|
||||
|
@ -292,7 +292,7 @@ EnumFontFamiliesExA (HDC hdc, LPLOGFONTA lpLogfont, FONTENUMPROCA lpEnumFontFamE
|
|||
{
|
||||
LOGFONTW LogFontW;
|
||||
|
||||
RosRtlLogFontA2W(&LogFontW, lpLogfont);
|
||||
LogFontA2W(&LogFontW, lpLogfont);
|
||||
|
||||
/* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only */
|
||||
return IntEnumFontFamilies(hdc, &LogFontW, lpEnumFontFamExProc, lParam, FALSE);
|
||||
|
@ -532,7 +532,7 @@ CreateFontIndirectA(
|
|||
{
|
||||
LOGFONTW tlf;
|
||||
|
||||
RosRtlLogFontA2W(&tlf, lplf);
|
||||
LogFontA2W(&tlf, lplf);
|
||||
|
||||
return NtGdiCreateFontIndirect(&tlf);
|
||||
}
|
||||
|
|
|
@ -331,3 +331,55 @@ ConvertBitmapInfo(
|
|||
|
||||
return NewBitmapInfo;
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
|
||||
{
|
||||
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
|
||||
#define COPYN(f) pW->f = pA->f
|
||||
|
||||
COPYN(lfHeight);
|
||||
COPYN(lfWidth);
|
||||
COPYN(lfEscapement);
|
||||
COPYN(lfOrientation);
|
||||
COPYN(lfWeight);
|
||||
COPYN(lfItalic);
|
||||
COPYN(lfUnderline);
|
||||
COPYN(lfStrikeOut);
|
||||
COPYN(lfCharSet);
|
||||
COPYN(lfOutPrecision);
|
||||
COPYN(lfClipPrecision);
|
||||
COPYN(lfQuality);
|
||||
COPYN(lfPitchAndFamily);
|
||||
COPYS(lfFaceName,LF_FACESIZE);
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
|
||||
{
|
||||
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
|
||||
#define COPYN(f) pA->f = pW->f
|
||||
|
||||
COPYN(lfHeight);
|
||||
COPYN(lfWidth);
|
||||
COPYN(lfEscapement);
|
||||
COPYN(lfOrientation);
|
||||
COPYN(lfWeight);
|
||||
COPYN(lfItalic);
|
||||
COPYN(lfUnderline);
|
||||
COPYN(lfStrikeOut);
|
||||
COPYN(lfCharSet);
|
||||
COPYN(lfOutPrecision);
|
||||
COPYN(lfClipPrecision);
|
||||
COPYN(lfQuality);
|
||||
COPYN(lfPitchAndFamily);
|
||||
COPYS(lfFaceName,LF_FACESIZE);
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <windows.h>
|
||||
#include <ddk/ntifs.h>
|
||||
#include <string.h>
|
||||
|
@ -113,3 +114,4 @@ QueryAllocatedFileRanges(HANDLE hFile,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <rosrtl/devmode.h>
|
||||
|
@ -144,3 +145,4 @@ RosRtlDevModeW2A( LPDEVMODEA pA, const LPDEVMODEW pW )
|
|||
#undef SIZEOF_DEVMODEW_300
|
||||
#undef SIZEOF_DEVMODEW_400
|
||||
#undef SIZEOF_DEVMODEW_500
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <rosrtl/logfont.h>
|
||||
|
@ -51,3 +52,4 @@ RosRtlLogFontW2A ( LPLOGFONTA pA, const LOGFONTW *pW )
|
|||
#undef COPYN
|
||||
#undef COPYS
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <windows.h>
|
||||
#include <rosrtl/priv.h>
|
||||
|
||||
|
@ -117,4 +118,5 @@ RosResetThreadPrivileges(HANDLE hToken)
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -124,5 +124,9 @@ typedef struct _USER32_THREAD_DATA
|
|||
|
||||
PUSER32_THREAD_DATA User32GetThreadData();
|
||||
|
||||
DEVMODEW *
|
||||
STDCALL
|
||||
GdiConvertToDevmodeW(DEVMODEA *dm);
|
||||
|
||||
#endif
|
||||
/* EOF */
|
||||
|
|
|
@ -10,8 +10,32 @@
|
|||
*/
|
||||
|
||||
#include <user32.h>
|
||||
#include <rosrtl/devmode.h>
|
||||
#include <rosrtl/logfont.h>
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
|
||||
{
|
||||
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
|
||||
#define COPYN(f) pA->f = pW->f
|
||||
|
||||
COPYN(lfHeight);
|
||||
COPYN(lfWidth);
|
||||
COPYN(lfEscapement);
|
||||
COPYN(lfOrientation);
|
||||
COPYN(lfWeight);
|
||||
COPYN(lfItalic);
|
||||
COPYN(lfUnderline);
|
||||
COPYN(lfStrikeOut);
|
||||
COPYN(lfCharSet);
|
||||
COPYN(lfOutPrecision);
|
||||
COPYN(lfClipPrecision);
|
||||
COPYN(lfQuality);
|
||||
COPYN(lfPitchAndFamily);
|
||||
COPYS(lfFaceName,LF_FACESIZE);
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
@ -76,11 +100,11 @@ SystemParametersInfoA(UINT uiAction,
|
|||
nclma->iSmCaptionHeight = nclmw.iSmCaptionHeight;
|
||||
nclma->iMenuWidth = nclmw.iMenuWidth;
|
||||
nclma->iMenuHeight = nclmw.iMenuHeight;
|
||||
RosRtlLogFontW2A(&(nclma->lfCaptionFont), &(nclmw.lfCaptionFont));
|
||||
RosRtlLogFontW2A(&(nclma->lfSmCaptionFont), &(nclmw.lfSmCaptionFont));
|
||||
RosRtlLogFontW2A(&(nclma->lfMenuFont), &(nclmw.lfMenuFont));
|
||||
RosRtlLogFontW2A(&(nclma->lfStatusFont), &(nclmw.lfStatusFont));
|
||||
RosRtlLogFontW2A(&(nclma->lfMessageFont), &(nclmw.lfMessageFont));
|
||||
LogFontW2A(&(nclma->lfCaptionFont), &(nclmw.lfCaptionFont));
|
||||
LogFontW2A(&(nclma->lfSmCaptionFont), &(nclmw.lfSmCaptionFont));
|
||||
LogFontW2A(&(nclma->lfMenuFont), &(nclmw.lfMenuFont));
|
||||
LogFontW2A(&(nclma->lfStatusFont), &(nclmw.lfStatusFont));
|
||||
LogFontW2A(&(nclma->lfMessageFont), &(nclmw.lfMessageFont));
|
||||
return TRUE;
|
||||
}
|
||||
case SPI_GETICONTITLELOGFONT:
|
||||
|
@ -88,7 +112,7 @@ SystemParametersInfoA(UINT uiAction,
|
|||
LOGFONTW lfw;
|
||||
if (!SystemParametersInfoW(uiAction, 0, &lfw, fWinIni))
|
||||
return FALSE;
|
||||
RosRtlLogFontW2A(pvParam, &lfw);
|
||||
LogFontW2A(pvParam, &lfw);
|
||||
return TRUE;
|
||||
}
|
||||
case SPI_GETDESKWALLPAPER:
|
||||
|
@ -310,7 +334,7 @@ CreateDesktopA(LPCSTR lpszDesktop,
|
|||
ANSI_STRING DesktopNameA;
|
||||
UNICODE_STRING DesktopNameU;
|
||||
HDESK hDesktop;
|
||||
DEVMODEW DevmodeW;
|
||||
LPDEVMODEW DevmodeW;
|
||||
|
||||
if (lpszDesktop != NULL)
|
||||
{
|
||||
|
@ -322,11 +346,11 @@ CreateDesktopA(LPCSTR lpszDesktop,
|
|||
RtlInitUnicodeString(&DesktopNameU, NULL);
|
||||
}
|
||||
|
||||
RosRtlDevModeA2W ( &DevmodeW, pDevmode );
|
||||
DevmodeW = GdiConvertToDevmodeW(pDevmode);
|
||||
|
||||
hDesktop = CreateDesktopW(DesktopNameU.Buffer,
|
||||
NULL,
|
||||
&DevmodeW,
|
||||
DevmodeW,
|
||||
dwFlags,
|
||||
dwDesiredAccess,
|
||||
lpsa);
|
||||
|
|
|
@ -29,7 +29,13 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <user32.h>
|
||||
#include <rosrtl/devmode.h>
|
||||
|
||||
#define SIZEOF_DEVMODEA_300 124
|
||||
#define SIZEOF_DEVMODEA_400 148
|
||||
#define SIZEOF_DEVMODEA_500 156
|
||||
#define SIZEOF_DEVMODEW_300 188
|
||||
#define SIZEOF_DEVMODEW_400 212
|
||||
#define SIZEOF_DEVMODEW_500 220
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
@ -211,8 +217,62 @@ EnumDisplaySettingsExA(
|
|||
rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &lpDevModeW,
|
||||
dwFlags );
|
||||
|
||||
RosRtlDevModeW2A ( lpDevMode, &lpDevModeW );
|
||||
#define COPYS(f,len) WideCharToMultiByte( CP_THREAD_ACP, 0, lpDevModeW.f, len, (LPSTR)lpDevMode->f, len, NULL, NULL )
|
||||
#define COPYN(f) lpDevMode->f = lpDevModeW.f
|
||||
COPYS(dmDeviceName, CCHDEVICENAME );
|
||||
COPYN(dmSpecVersion);
|
||||
COPYN(dmDriverVersion);
|
||||
switch ( lpDevModeW.dmSize )
|
||||
{
|
||||
case SIZEOF_DEVMODEW_300:
|
||||
lpDevMode->dmSize = SIZEOF_DEVMODEA_300;
|
||||
break;
|
||||
case SIZEOF_DEVMODEW_400:
|
||||
lpDevMode->dmSize = SIZEOF_DEVMODEA_400;
|
||||
break;
|
||||
case SIZEOF_DEVMODEW_500:
|
||||
default: /* FIXME what to do??? */
|
||||
lpDevMode->dmSize = SIZEOF_DEVMODEA_500;
|
||||
break;
|
||||
}
|
||||
COPYN(dmDriverExtra);
|
||||
COPYN(dmFields);
|
||||
COPYN(dmPosition.x);
|
||||
COPYN(dmPosition.y);
|
||||
COPYN(dmScale);
|
||||
COPYN(dmCopies);
|
||||
COPYN(dmDefaultSource);
|
||||
COPYN(dmPrintQuality);
|
||||
COPYN(dmColor);
|
||||
COPYN(dmDuplex);
|
||||
COPYN(dmYResolution);
|
||||
COPYN(dmTTOption);
|
||||
COPYN(dmCollate);
|
||||
COPYS(dmFormName,CCHFORMNAME);
|
||||
COPYN(dmLogPixels);
|
||||
COPYN(dmBitsPerPel);
|
||||
COPYN(dmPelsWidth);
|
||||
COPYN(dmPelsHeight);
|
||||
COPYN(dmDisplayFlags); // aka dmNup
|
||||
COPYN(dmDisplayFrequency);
|
||||
|
||||
if ( lpDevModeW.dmSize <= SIZEOF_DEVMODEW_300 )
|
||||
goto done; // we're done with 0x300 fields
|
||||
|
||||
COPYN(dmICMMethod);
|
||||
COPYN(dmICMIntent);
|
||||
COPYN(dmMediaType);
|
||||
COPYN(dmDitherType);
|
||||
COPYN(dmReserved1);
|
||||
COPYN(dmReserved2);
|
||||
|
||||
if ( lpDevModeW.dmSize <= SIZEOF_DEVMODEW_400 )
|
||||
goto done; // we're done with 0x400 fields
|
||||
|
||||
COPYN(dmPanningWidth);
|
||||
COPYN(dmPanningHeight);
|
||||
|
||||
done:
|
||||
RtlFreeUnicodeString ( &DeviceName );
|
||||
|
||||
|
||||
|
@ -380,8 +440,7 @@ ChangeDisplaySettingsExA(
|
|||
LONG rc;
|
||||
UNICODE_STRING DeviceName;
|
||||
PUNICODE_STRING pDeviceName = &DeviceName;
|
||||
DEVMODEW DevModeW;
|
||||
LPDEVMODEW pDevModeW = &DevModeW;
|
||||
LPDEVMODEW pDevModeW;
|
||||
|
||||
if (lpszDeviceName != NULL)
|
||||
{
|
||||
|
@ -395,7 +454,7 @@ ChangeDisplaySettingsExA(
|
|||
pDeviceName = NULL;
|
||||
|
||||
if (lpDevMode != NULL)
|
||||
RosRtlDevModeA2W ( pDevModeW, lpDevMode );
|
||||
pDevModeW = GdiConvertToDevmodeW(lpDevMode);
|
||||
else
|
||||
pDevModeW = NULL;
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <ndk/ntndk.h>
|
||||
#include <ddk/ntddblue.h>
|
||||
#include <rosrtl/string.h>
|
||||
#include <rosrtl/minmax.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -420,8 +419,8 @@ ConioWriteConsole(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff,
|
|||
}
|
||||
Offset = 2 * ((Buff->CurrentY * Buff->MaxX) + Buff->CurrentX);
|
||||
SET_CELL_BUFFER(Buff, Offset, ' ', Buff->DefaultAttrib);
|
||||
UpdateRect.left = RtlRosMin(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = RtlRosMax(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
UpdateRect.left = min(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -429,8 +428,8 @@ ConioWriteConsole(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff,
|
|||
else if (Buffer[i] == '\r')
|
||||
{
|
||||
Buff->CurrentX = 0;
|
||||
UpdateRect.left = RtlRosMin(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = RtlRosMax(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
UpdateRect.left = min(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
continue;
|
||||
}
|
||||
/* --- TAB --- */
|
||||
|
@ -438,7 +437,7 @@ ConioWriteConsole(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff,
|
|||
{
|
||||
UINT EndX;
|
||||
|
||||
UpdateRect.left = RtlRosMin(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.left = min(UpdateRect.left, Buff->CurrentX);
|
||||
EndX = (Buff->CurrentX + 8) & ~7;
|
||||
if (EndX > Buff->MaxX)
|
||||
{
|
||||
|
@ -451,7 +450,7 @@ ConioWriteConsole(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff,
|
|||
Offset += 2;
|
||||
Buff->CurrentX++;
|
||||
}
|
||||
UpdateRect.right = RtlRosMax(UpdateRect.right, (LONG) Buff->CurrentX - 1);
|
||||
UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX - 1);
|
||||
if (Buff->CurrentX == Buff->MaxX)
|
||||
{
|
||||
if (Buff->Mode & ENABLE_WRAP_AT_EOL_OUTPUT)
|
||||
|
@ -467,8 +466,8 @@ ConioWriteConsole(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff,
|
|||
continue;
|
||||
}
|
||||
}
|
||||
UpdateRect.left = RtlRosMin(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = RtlRosMax(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
UpdateRect.left = min(UpdateRect.left, Buff->CurrentX);
|
||||
UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX);
|
||||
Offset = 2 * (((Buff->CurrentY * Buff->MaxX)) + Buff->CurrentX);
|
||||
Buff->Buffer[Offset++] = Buffer[i];
|
||||
if (Attrib)
|
||||
|
@ -679,10 +678,10 @@ inline BOOLEAN ConioGetIntersection(
|
|||
}
|
||||
|
||||
ConioInitRect(Intersection,
|
||||
RtlRosMax(Rect1->top, Rect2->top),
|
||||
RtlRosMax(Rect1->left, Rect2->left),
|
||||
RtlRosMin(Rect1->bottom, Rect2->bottom),
|
||||
RtlRosMin(Rect1->right, Rect2->right));
|
||||
max(Rect1->top, Rect2->top),
|
||||
max(Rect1->left, Rect2->left),
|
||||
min(Rect1->bottom, Rect2->bottom),
|
||||
min(Rect1->right, Rect2->right));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -711,10 +710,10 @@ inline BOOLEAN ConioGetUnion(
|
|||
else
|
||||
{
|
||||
ConioInitRect(Union,
|
||||
RtlRosMin(Rect1->top, Rect2->top),
|
||||
RtlRosMin(Rect1->left, Rect2->left),
|
||||
RtlRosMax(Rect1->bottom, Rect2->bottom),
|
||||
RtlRosMax(Rect1->right, Rect2->right));
|
||||
min(Rect1->top, Rect2->top),
|
||||
min(Rect1->left, Rect2->left),
|
||||
max(Rect1->bottom, Rect2->bottom),
|
||||
max(Rect1->right, Rect2->right));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -2299,8 +2298,8 @@ CSR_API(CsrWriteConsoleOutput)
|
|||
WriteRegion.right = Request->Data.WriteConsoleOutputRequest.WriteRegion.Right;
|
||||
WriteRegion.bottom = Request->Data.WriteConsoleOutputRequest.WriteRegion.Bottom;
|
||||
|
||||
SizeY = RtlRosMin(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&WriteRegion));
|
||||
SizeX = RtlRosMin(BufferSize.X - BufferCoord.X, ConioRectWidth(&WriteRegion));
|
||||
SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&WriteRegion));
|
||||
SizeX = min(BufferSize.X - BufferCoord.X, ConioRectWidth(&WriteRegion));
|
||||
WriteRegion.bottom = WriteRegion.top + SizeY - 1;
|
||||
WriteRegion.right = WriteRegion.left + SizeX - 1;
|
||||
|
||||
|
@ -2797,8 +2796,8 @@ CSR_API(CsrReadConsoleOutput)
|
|||
return Request->Status ;
|
||||
}
|
||||
|
||||
SizeY = RtlRosMin(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&ReadRegion));
|
||||
SizeX = RtlRosMin(BufferSize.X - BufferCoord.X, ConioRectWidth(&ReadRegion));
|
||||
SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&ReadRegion));
|
||||
SizeX = min(BufferSize.X - BufferCoord.X, ConioRectWidth(&ReadRegion));
|
||||
ReadRegion.bottom = ReadRegion.top + SizeY;
|
||||
ReadRegion.right = ReadRegion.left + SizeX;
|
||||
|
||||
|
|
Loading…
Reference in a new issue