mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 04:35:53 +00:00
[GDI32]
- Consistent formatting, no code change. svn path=/trunk/; revision=50163
This commit is contained in:
parent
f7ab02f22e
commit
c7c2a79d5b
28 changed files with 6911 additions and 6873 deletions
|
@ -44,55 +44,55 @@ typedef INT
|
|||
// Based on wmfapi.h and Wine.
|
||||
typedef struct tagMETAFILEDC
|
||||
{
|
||||
PVOID pvMetaBuffer;
|
||||
HANDLE hFile;
|
||||
DWORD Size;
|
||||
DWORD dwWritten;
|
||||
METAHEADER mh;
|
||||
WORD reserved;
|
||||
HLOCAL MFObjList;
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
HDC hDc;
|
||||
HGDIOBJ hMetaDc;
|
||||
HPALETTE hPalette;
|
||||
HFONT hFont;
|
||||
HBITMAP hBitmap;
|
||||
HRGN hRegion;
|
||||
HGDIOBJ hMetafile;
|
||||
HGDIOBJ hMemDc;
|
||||
HPEN hExtPen;
|
||||
HGDIOBJ hEnhMetaDc;
|
||||
HGDIOBJ hEnhMetaFile;
|
||||
HCOLORSPACE hColorSpace;
|
||||
WCHAR Filename[MAX_PATH+2];
|
||||
PVOID pvMetaBuffer;
|
||||
HANDLE hFile;
|
||||
DWORD Size;
|
||||
DWORD dwWritten;
|
||||
METAHEADER mh;
|
||||
WORD reserved;
|
||||
HLOCAL MFObjList;
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
HDC hDc;
|
||||
HGDIOBJ hMetaDc;
|
||||
HPALETTE hPalette;
|
||||
HFONT hFont;
|
||||
HBITMAP hBitmap;
|
||||
HRGN hRegion;
|
||||
HGDIOBJ hMetafile;
|
||||
HGDIOBJ hMemDc;
|
||||
HPEN hExtPen;
|
||||
HGDIOBJ hEnhMetaDc;
|
||||
HGDIOBJ hEnhMetaFile;
|
||||
HCOLORSPACE hColorSpace;
|
||||
WCHAR Filename[MAX_PATH+2];
|
||||
} METAFILEDC,*PMETAFILEDC;
|
||||
|
||||
// Metafile Entry handle
|
||||
typedef struct tagMF_ENTRY
|
||||
{
|
||||
LIST_ENTRY List;
|
||||
HGDIOBJ hmDC; // Handle return from NtGdiCreateClientObj.
|
||||
PMETAFILEDC pmfDC;
|
||||
LIST_ENTRY List;
|
||||
HGDIOBJ hmDC; // Handle return from NtGdiCreateClientObj.
|
||||
PMETAFILEDC pmfDC;
|
||||
} MF_ENTRY, *PMF_ENTRY;
|
||||
|
||||
typedef struct tagENHMETAFILE
|
||||
{
|
||||
PVOID pvMetaBuffer;
|
||||
HANDLE hFile; /* Handle for disk based MetaFile */
|
||||
DWORD Size;
|
||||
INT iType;
|
||||
PENHMETAHEADER emf;
|
||||
UINT handles_size, cur_handles;
|
||||
HGDIOBJ *handles;
|
||||
INT horzres, vertres;
|
||||
INT horzsize, vertsize;
|
||||
INT logpixelsx, logpixelsy;
|
||||
INT bitspixel;
|
||||
INT textcaps;
|
||||
INT rastercaps;
|
||||
INT technology;
|
||||
INT planes;
|
||||
PVOID pvMetaBuffer;
|
||||
HANDLE hFile; /* Handle for disk based MetaFile */
|
||||
DWORD Size;
|
||||
INT iType;
|
||||
PENHMETAHEADER emf;
|
||||
UINT handles_size, cur_handles;
|
||||
HGDIOBJ *handles;
|
||||
INT horzres, vertres;
|
||||
INT horzsize, vertsize;
|
||||
INT logpixelsx, logpixelsy;
|
||||
INT bitspixel;
|
||||
INT textcaps;
|
||||
INT rastercaps;
|
||||
INT technology;
|
||||
INT planes;
|
||||
} ENHMETAFILE,*PENHMETAFILE;
|
||||
|
||||
|
||||
|
@ -102,26 +102,26 @@ typedef struct tagENHMETAFILE
|
|||
#define UMPDEV_SUPPORT_ESCAPE 0x0004
|
||||
typedef struct _UMPDEV
|
||||
{
|
||||
DWORD Sig; // Init with PDEV_UMPD_ID
|
||||
struct _UMPDEV *pumpdNext;
|
||||
PDRIVER_INFO_5W pdi5Info;
|
||||
HMODULE hModule;
|
||||
DWORD dwFlags;
|
||||
DWORD dwDriverAttributes;
|
||||
DWORD dwConfigVersion; // Number of times the configuration
|
||||
// file for this driver has been upgraded
|
||||
// or downgraded since the last spooler restart.
|
||||
DWORD dwDriverCount; // After init should be 2
|
||||
DWORD WOW64_UMPDev;
|
||||
DWORD WOW64_hMod;
|
||||
DWORD Unknown;
|
||||
PVOID apfn[INDEX_LAST]; // Print Driver pfn
|
||||
DWORD Sig; // Init with PDEV_UMPD_ID
|
||||
struct _UMPDEV *pumpdNext;
|
||||
PDRIVER_INFO_5W pdi5Info;
|
||||
HMODULE hModule;
|
||||
DWORD dwFlags;
|
||||
DWORD dwDriverAttributes;
|
||||
DWORD dwConfigVersion; // Number of times the configuration
|
||||
// file for this driver has been upgraded
|
||||
// or downgraded since the last spooler restart.
|
||||
DWORD dwDriverCount; // After init should be 2
|
||||
DWORD WOW64_UMPDev;
|
||||
DWORD WOW64_hMod;
|
||||
DWORD Unknown;
|
||||
PVOID apfn[INDEX_LAST]; // Print Driver pfn
|
||||
} UMPDEV, *PUMPDEV;
|
||||
|
||||
#define LOCALFONT_COUNT 10
|
||||
typedef struct _LOCALFONT
|
||||
{
|
||||
FONT_ATTR lfa[LOCALFONT_COUNT];
|
||||
FONT_ATTR lfa[LOCALFONT_COUNT];
|
||||
} LOCALFONT, *PLOCALFONT;
|
||||
|
||||
// sdk/winspool.h
|
||||
|
@ -322,35 +322,35 @@ GdiAllocBatchCommand(
|
|||
/* Get the size of the entry */
|
||||
switch(Cmd)
|
||||
{
|
||||
case GdiBCPatBlt:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCPolyPatBlt:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCTextOut:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCExtTextOut:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCSetBrushOrg:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCExtSelClipRgn:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCSelObj:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
case GdiBCDelRgn:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
case GdiBCDelObj:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
case GdiBCPatBlt:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCPolyPatBlt:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCTextOut:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCExtTextOut:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCSetBrushOrg:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCExtSelClipRgn:
|
||||
ulSize = 0;
|
||||
break;
|
||||
case GdiBCSelObj:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
case GdiBCDelRgn:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
case GdiBCDelObj:
|
||||
ulSize = sizeof(GDIBSOBJECT);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Unsupported operation */
|
||||
|
@ -358,7 +358,7 @@ GdiAllocBatchCommand(
|
|||
|
||||
/* Check if the buffer is full */
|
||||
if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
|
||||
((pTeb->GdiTebBatch.Offset + ulSize) > GDIBATCHBUFSIZE))
|
||||
((pTeb->GdiTebBatch.Offset + ulSize) > GDIBATCHBUFSIZE))
|
||||
{
|
||||
/* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
|
||||
the current batch */
|
||||
|
|
|
@ -29,12 +29,12 @@ DllMain (
|
|||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH :
|
||||
DisableThreadLibraryCalls(hDll);
|
||||
break;
|
||||
case DLL_PROCESS_ATTACH :
|
||||
DisableThreadLibraryCalls(hDll);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -69,17 +69,17 @@ GdiDllInitialize (
|
|||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
GdiProcessSetup ();
|
||||
break;
|
||||
case DLL_PROCESS_ATTACH:
|
||||
GdiProcessSetup ();
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
NtCurrentTeb()->GdiTebBatch.Offset = 0;
|
||||
NtCurrentTeb()->GdiBatchCount = 0;
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
NtCurrentTeb()->GdiTebBatch.Offset = 0;
|
||||
NtCurrentTeb()->GdiBatchCount = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Very simple, the list will fill itself as it is needed.
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,36 +35,36 @@ HANDLE hProcessHeap = NULL;
|
|||
PVOID
|
||||
HEAP_alloc ( DWORD len )
|
||||
{
|
||||
/* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
|
||||
assert(hProcessHeap);
|
||||
return RtlAllocateHeap ( hProcessHeap, 0, len );
|
||||
/* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
|
||||
assert(hProcessHeap);
|
||||
return RtlAllocateHeap ( hProcessHeap, 0, len );
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
HEAP_strdupA2W ( LPWSTR* ppszW, LPCSTR lpszA )
|
||||
{
|
||||
ULONG len;
|
||||
NTSTATUS Status;
|
||||
ULONG len;
|
||||
NTSTATUS Status;
|
||||
|
||||
*ppszW = NULL;
|
||||
if ( !lpszA )
|
||||
return STATUS_SUCCESS;
|
||||
len = lstrlenA(lpszA);
|
||||
*ppszW = NULL;
|
||||
if ( !lpszA )
|
||||
return STATUS_SUCCESS;
|
||||
len = lstrlenA(lpszA);
|
||||
|
||||
*ppszW = HEAP_alloc ( (len+1) * sizeof(WCHAR) );
|
||||
if ( !*ppszW )
|
||||
return STATUS_NO_MEMORY;
|
||||
Status = RtlMultiByteToUnicodeN ( *ppszW, len*sizeof(WCHAR), NULL, (PCHAR)lpszA, len );
|
||||
(*ppszW)[len] = L'\0';
|
||||
return Status;
|
||||
*ppszW = HEAP_alloc ( (len+1) * sizeof(WCHAR) );
|
||||
if ( !*ppszW )
|
||||
return STATUS_NO_MEMORY;
|
||||
Status = RtlMultiByteToUnicodeN ( *ppszW, len*sizeof(WCHAR), NULL, (PCHAR)lpszA, len );
|
||||
(*ppszW)[len] = L'\0';
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
HEAP_free ( LPVOID memory )
|
||||
{
|
||||
/* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
|
||||
assert(hProcessHeap);
|
||||
/* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
|
||||
assert(hProcessHeap);
|
||||
|
||||
RtlFreeHeap ( hProcessHeap, 0, memory );
|
||||
RtlFreeHeap ( hProcessHeap, 0, memory );
|
||||
}
|
||||
|
|
|
@ -39,36 +39,36 @@ DWORD GDI_BatchLimit = 1;
|
|||
BOOL
|
||||
WINAPI
|
||||
GdiAlphaBlend(
|
||||
HDC hDCDst,
|
||||
int DstX,
|
||||
int DstY,
|
||||
int DstCx,
|
||||
int DstCy,
|
||||
HDC hDCSrc,
|
||||
int SrcX,
|
||||
int SrcY,
|
||||
int SrcCx,
|
||||
int SrcCy,
|
||||
BLENDFUNCTION BlendFunction
|
||||
)
|
||||
HDC hDCDst,
|
||||
int DstX,
|
||||
int DstY,
|
||||
int DstCx,
|
||||
int DstCy,
|
||||
HDC hDCSrc,
|
||||
int SrcX,
|
||||
int SrcY,
|
||||
int SrcCx,
|
||||
int SrcCy,
|
||||
BLENDFUNCTION BlendFunction
|
||||
)
|
||||
{
|
||||
if ( hDCSrc == NULL ) return FALSE;
|
||||
if ( hDCSrc == NULL ) return FALSE;
|
||||
|
||||
if (GDI_HANDLE_GET_TYPE(hDCSrc) == GDI_OBJECT_TYPE_METADC) return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDCSrc) == GDI_OBJECT_TYPE_METADC) return FALSE;
|
||||
|
||||
return NtGdiAlphaBlend(
|
||||
hDCDst,
|
||||
DstX,
|
||||
DstY,
|
||||
DstCx,
|
||||
DstCy,
|
||||
hDCSrc,
|
||||
SrcX,
|
||||
SrcY,
|
||||
SrcCx,
|
||||
SrcCy,
|
||||
return NtGdiAlphaBlend(
|
||||
hDCDst,
|
||||
DstX,
|
||||
DstY,
|
||||
DstCx,
|
||||
DstCy,
|
||||
hDCSrc,
|
||||
SrcX,
|
||||
SrcY,
|
||||
SrcCx,
|
||||
SrcCy,
|
||||
BlendFunction,
|
||||
0 );
|
||||
0 );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -89,7 +89,7 @@ GdiFixUpHandle(HGDIOBJ hGdiObj)
|
|||
|
||||
Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
|
||||
|
||||
/* Rebuild handle for Object */
|
||||
/* Rebuild handle for Object */
|
||||
return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) | (Entry->Type << GDI_ENTRY_UPPER_SHIFT));
|
||||
}
|
||||
|
||||
|
@ -100,99 +100,99 @@ PVOID
|
|||
WINAPI
|
||||
GdiQueryTable(VOID)
|
||||
{
|
||||
return (PVOID)GdiHandleTable;
|
||||
return (PVOID)GdiHandleTable;
|
||||
}
|
||||
|
||||
BOOL GdiIsHandleValid(HGDIOBJ hGdiObj)
|
||||
{
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
|
||||
// We are only looking for TYPE not the rest here, and why is FullUnique filled up with CRAP!?
|
||||
// DPRINT1("FullUnique -> %x\n", Entry->FullUnique);
|
||||
if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
|
||||
( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) ==
|
||||
GDI_HANDLE_GET_TYPE(hGdiObj))
|
||||
{
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
if(pid == NULL || pid == CurrentProcessId)
|
||||
if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
|
||||
( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) ==
|
||||
GDI_HANDLE_GET_TYPE(hGdiObj))
|
||||
{
|
||||
return TRUE;
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
if(pid == NULL || pid == CurrentProcessId)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
|
||||
{
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
|
||||
if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == ObjectType &&
|
||||
( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) ==
|
||||
GDI_HANDLE_GET_TYPE(hGdiObj))
|
||||
{
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
if(pid == NULL || pid == CurrentProcessId)
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
|
||||
if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == ObjectType &&
|
||||
( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) ==
|
||||
GDI_HANDLE_GET_TYPE(hGdiObj))
|
||||
{
|
||||
//
|
||||
// Need to test if we have Read & Write access to the VM address space.
|
||||
//
|
||||
BOOL Result = TRUE;
|
||||
if(Entry->UserData)
|
||||
{
|
||||
volatile CHAR *Current = (volatile CHAR*)Entry->UserData;
|
||||
_SEH2_TRY
|
||||
{
|
||||
*Current = *Current;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Result = FALSE;
|
||||
}
|
||||
_SEH2_END
|
||||
}
|
||||
else
|
||||
Result = FALSE; // Can not be zero.
|
||||
if (Result) *UserData = Entry->UserData;
|
||||
return Result;
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
if(pid == NULL || pid == CurrentProcessId)
|
||||
{
|
||||
//
|
||||
// Need to test if we have Read & Write access to the VM address space.
|
||||
//
|
||||
BOOL Result = TRUE;
|
||||
if(Entry->UserData)
|
||||
{
|
||||
volatile CHAR *Current = (volatile CHAR*)Entry->UserData;
|
||||
_SEH2_TRY
|
||||
{
|
||||
*Current = *Current;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Result = FALSE;
|
||||
}
|
||||
_SEH2_END
|
||||
}
|
||||
else
|
||||
Result = FALSE; // Can not be zero.
|
||||
if (Result) *UserData = Entry->UserData;
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PLDC
|
||||
FASTCALL
|
||||
GdiGetLDC(HDC hDC)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX((HGDIOBJ) hDC);
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
// Don't check the mask, just the object type.
|
||||
if ( Entry->ObjectType == GDIObjType_DC_TYPE &&
|
||||
(pid == NULL || pid == CurrentProcessId) )
|
||||
{
|
||||
BOOL Result = TRUE;
|
||||
if (Entry->UserData)
|
||||
{
|
||||
volatile CHAR *Current = (volatile CHAR*)Entry->UserData;
|
||||
_SEH2_TRY
|
||||
PDC_ATTR Dc_Attr;
|
||||
PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX((HGDIOBJ) hDC);
|
||||
HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
// Don't check the mask, just the object type.
|
||||
if ( Entry->ObjectType == GDIObjType_DC_TYPE &&
|
||||
(pid == NULL || pid == CurrentProcessId) )
|
||||
{
|
||||
BOOL Result = TRUE;
|
||||
if (Entry->UserData)
|
||||
{
|
||||
*Current = *Current;
|
||||
volatile CHAR *Current = (volatile CHAR*)Entry->UserData;
|
||||
_SEH2_TRY
|
||||
{
|
||||
*Current = *Current;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Result = FALSE;
|
||||
}
|
||||
_SEH2_END
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Result = FALSE;
|
||||
}
|
||||
_SEH2_END
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
else
|
||||
Result = FALSE;
|
||||
|
||||
if (Result)
|
||||
{
|
||||
Dc_Attr = (PDC_ATTR)Entry->UserData;
|
||||
return Dc_Attr->pvLDC;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
if (Result)
|
||||
{
|
||||
Dc_Attr = (PDC_ATTR)Entry->UserData;
|
||||
return Dc_Attr->pvLDC;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VOID GdiSAPCallback(PLDC pldc)
|
||||
|
@ -207,8 +207,8 @@ VOID GdiSAPCallback(PLDC pldc)
|
|||
|
||||
if ( !pldc->pAbortProc(pldc->hDC, 0) )
|
||||
{
|
||||
CancelDC(pldc->hDC);
|
||||
AbortDoc(pldc->hDC);
|
||||
CancelDC(pldc->hDC);
|
||||
AbortDoc(pldc->hDC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ GdiSetBatchLimit(DWORD Limit)
|
|||
DWORD OldLimit = GDI_BatchLimit;
|
||||
|
||||
if ( (!Limit) ||
|
||||
(Limit >= GDI_BATCH_LIMIT))
|
||||
(Limit >= GDI_BATCH_LIMIT))
|
||||
{
|
||||
return Limit;
|
||||
}
|
||||
|
@ -289,40 +289,40 @@ HGDIOBJ
|
|||
FASTCALL
|
||||
hGetPEBHandle(HANDLECACHETYPE Type, COLORREF cr)
|
||||
{
|
||||
int Number;
|
||||
HANDLE Lock;
|
||||
HGDIOBJ Handle = NULL;
|
||||
int Number;
|
||||
HANDLE Lock;
|
||||
HGDIOBJ Handle = NULL;
|
||||
|
||||
Lock = InterlockedCompareExchangePointer( (PVOID*)&GdiHandleCache->ulLock,
|
||||
NtCurrentTeb(),
|
||||
NULL );
|
||||
|
||||
if (Lock) return Handle;
|
||||
Lock = InterlockedCompareExchangePointer( (PVOID*)&GdiHandleCache->ulLock,
|
||||
NtCurrentTeb(),
|
||||
NULL );
|
||||
|
||||
Number = GdiHandleCache->ulNumHandles[Type];
|
||||
if (Lock) return Handle;
|
||||
|
||||
if ( Number && Number <= CACHE_REGION_ENTRIES )
|
||||
{
|
||||
if ( Type == hctRegionHandle)
|
||||
{
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HGDIOBJ *hPtr;
|
||||
hPtr = GdiHandleCache->Handle + CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES;
|
||||
Handle = hPtr[Number - 1];
|
||||
Number = GdiHandleCache->ulNumHandles[Type];
|
||||
|
||||
if (GdiGetHandleUserData( Handle, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr))
|
||||
{
|
||||
if (pRgn_Attr->AttrFlags & ATTR_CACHED)
|
||||
if ( Number && Number <= CACHE_REGION_ENTRIES )
|
||||
{
|
||||
if ( Type == hctRegionHandle)
|
||||
{
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HGDIOBJ *hPtr;
|
||||
hPtr = GdiHandleCache->Handle + CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES;
|
||||
Handle = hPtr[Number - 1];
|
||||
|
||||
if (GdiGetHandleUserData( Handle, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr))
|
||||
{
|
||||
DPRINT("Get Handle! Count %d PEB 0x%x\n", GdiHandleCache->ulNumHandles[Type], NtCurrentTeb()->ProcessEnvironmentBlock);
|
||||
pRgn_Attr->AttrFlags &= ~ATTR_CACHED;
|
||||
hPtr[Number - 1] = NULL;
|
||||
GdiHandleCache->ulNumHandles[Type]--;
|
||||
if (pRgn_Attr->AttrFlags & ATTR_CACHED)
|
||||
{
|
||||
DPRINT("Get Handle! Count %d PEB 0x%x\n", GdiHandleCache->ulNumHandles[Type], NtCurrentTeb()->ProcessEnvironmentBlock);
|
||||
pRgn_Attr->AttrFlags &= ~ATTR_CACHED;
|
||||
hPtr[Number - 1] = NULL;
|
||||
GdiHandleCache->ulNumHandles[Type]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(void)InterlockedExchangePointer((PVOID*)&GdiHandleCache->ulLock, Lock);
|
||||
return Handle;
|
||||
}
|
||||
}
|
||||
(void)InterlockedExchangePointer((PVOID*)&GdiHandleCache->ulLock, Lock);
|
||||
return Handle;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -31,14 +31,14 @@ PolyTextOutA( HDC hdc, const POLYTEXTA *pptxt, INT cStrings )
|
|||
BOOL
|
||||
WINAPI
|
||||
GetLogColorSpaceA(
|
||||
HCOLORSPACE a0,
|
||||
LPLOGCOLORSPACEA a1,
|
||||
DWORD a2
|
||||
)
|
||||
HCOLORSPACE a0,
|
||||
LPLOGCOLORSPACEA a1,
|
||||
DWORD a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,10 +48,10 @@ GetLogColorSpaceA(
|
|||
BOOL
|
||||
WINAPI
|
||||
GetICMProfileA(
|
||||
HDC hdc,
|
||||
LPDWORD pBufSize,
|
||||
LPSTR pszFilename
|
||||
)
|
||||
HDC hdc,
|
||||
LPDWORD pBufSize,
|
||||
LPSTR pszFilename
|
||||
)
|
||||
{
|
||||
WCHAR filenameW[MAX_PATH];
|
||||
DWORD buflen = MAX_PATH;
|
||||
|
@ -81,13 +81,13 @@ GetICMProfileA(
|
|||
BOOL
|
||||
WINAPI
|
||||
SetICMProfileA(
|
||||
HDC a0,
|
||||
LPSTR a1
|
||||
)
|
||||
HDC a0,
|
||||
LPSTR a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,24 +97,24 @@ SetICMProfileA(
|
|||
int
|
||||
WINAPI
|
||||
EnumICMProfilesA(
|
||||
HDC a0,
|
||||
ICMENUMPROCA a1,
|
||||
LPARAM a2
|
||||
)
|
||||
HDC a0,
|
||||
ICMENUMPROCA a1,
|
||||
LPARAM a2
|
||||
)
|
||||
{
|
||||
/*
|
||||
* FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
|
||||
* to find out how big a buffer we need. Then allocate that buffer
|
||||
* and call NtGdiEnumICMProfiles again to have the buffer filled.
|
||||
*
|
||||
* Finally, step through the buffer ( MULTI-SZ recommended for format ),
|
||||
* and convert each string to ANSI, calling the user's callback function
|
||||
* until we run out of strings or the user returns FALSE
|
||||
*/
|
||||
/*
|
||||
* FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
|
||||
* to find out how big a buffer we need. Then allocate that buffer
|
||||
* and call NtGdiEnumICMProfiles again to have the buffer filled.
|
||||
*
|
||||
* Finally, step through the buffer ( MULTI-SZ recommended for format ),
|
||||
* and convert each string to ANSI, calling the user's callback function
|
||||
* until we run out of strings or the user returns FALSE
|
||||
*/
|
||||
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,15 +124,15 @@ EnumICMProfilesA(
|
|||
BOOL
|
||||
WINAPI
|
||||
UpdateICMRegKeyA(
|
||||
DWORD a0,
|
||||
LPSTR a1,
|
||||
LPSTR a2,
|
||||
UINT a3
|
||||
)
|
||||
DWORD a0,
|
||||
LPSTR a1,
|
||||
LPSTR a2,
|
||||
UINT a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -31,14 +31,14 @@ PolyTextOutW( HDC hdc, const POLYTEXTW *pptxt, INT cStrings )
|
|||
BOOL
|
||||
WINAPI
|
||||
GetLogColorSpaceW(
|
||||
HCOLORSPACE a0,
|
||||
LPLOGCOLORSPACEW a1,
|
||||
DWORD a2
|
||||
)
|
||||
HCOLORSPACE a0,
|
||||
LPLOGCOLORSPACEW a1,
|
||||
DWORD a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,16 +48,16 @@ GetLogColorSpaceW(
|
|||
BOOL
|
||||
WINAPI
|
||||
GetICMProfileW(
|
||||
HDC hdc,
|
||||
LPDWORD size,
|
||||
LPWSTR filename
|
||||
)
|
||||
HDC hdc,
|
||||
LPDWORD size,
|
||||
LPWSTR filename
|
||||
)
|
||||
{
|
||||
if (!hdc || !size || !filename) return FALSE;
|
||||
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,13 +67,13 @@ GetICMProfileW(
|
|||
BOOL
|
||||
WINAPI
|
||||
SetICMProfileW(
|
||||
HDC a0,
|
||||
LPWSTR a1
|
||||
)
|
||||
HDC a0,
|
||||
LPWSTR a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,23 +83,23 @@ SetICMProfileW(
|
|||
int
|
||||
WINAPI
|
||||
EnumICMProfilesW(
|
||||
HDC hDC,
|
||||
ICMENUMPROCW lpEnumICMProfilesFunc,
|
||||
LPARAM lParam
|
||||
)
|
||||
HDC hDC,
|
||||
ICMENUMPROCW lpEnumICMProfilesFunc,
|
||||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
/*
|
||||
* FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
|
||||
* to find out how big a buffer we need. Then allocate that buffer
|
||||
* and call NtGdiEnumICMProfiles again to have the buffer filled.
|
||||
*
|
||||
* Finally, step through the buffer ( MULTI-SZ recommended for format ),
|
||||
* and call the user's callback function until we run out of strings or
|
||||
* the user returns FALSE
|
||||
*/
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
/*
|
||||
* FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
|
||||
* to find out how big a buffer we need. Then allocate that buffer
|
||||
* and call NtGdiEnumICMProfiles again to have the buffer filled.
|
||||
*
|
||||
* Finally, step through the buffer ( MULTI-SZ recommended for format ),
|
||||
* and call the user's callback function until we run out of strings or
|
||||
* the user returns FALSE
|
||||
*/
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,15 +109,15 @@ EnumICMProfilesW(
|
|||
BOOL
|
||||
WINAPI
|
||||
UpdateICMRegKeyW(
|
||||
DWORD a0,
|
||||
LPWSTR a1,
|
||||
LPWSTR a2,
|
||||
UINT a3
|
||||
)
|
||||
DWORD a0,
|
||||
LPWSTR a1,
|
||||
LPWSTR a2,
|
||||
UINT a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -134,9 +134,9 @@ BOOL
|
|||
WINAPI
|
||||
EudcLoadLinkW(LPCWSTR pBaseFaceName,LPCWSTR pEudcFontPath,INT iPriority,INT iFontLinkType)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -146,9 +146,9 @@ BOOL
|
|||
WINAPI
|
||||
EudcUnloadLinkW(LPCWSTR pBaseFaceName,LPCWSTR pEudcFontPath)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -194,9 +194,9 @@ BOOL
|
|||
WINAPI
|
||||
bInitSystemAndFontsDirectoriesW(LPWSTR *SystemDir,LPWSTR *FontsDir)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -206,9 +206,9 @@ BOOL
|
|||
WINAPI
|
||||
bMakePathNameW(LPWSTR lpBuffer,LPCWSTR lpFileName,LPWSTR *lpFilePart,DWORD unknown)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -237,11 +237,11 @@ GetStringBitmapW(HDC hdc,
|
|||
BOOL
|
||||
WINAPI
|
||||
CreateScalableFontResourceW(
|
||||
DWORD fdwHidden,
|
||||
LPCWSTR lpszFontRes,
|
||||
LPCWSTR lpszFontFile,
|
||||
LPCWSTR lpszCurrentPath
|
||||
)
|
||||
DWORD fdwHidden,
|
||||
LPCWSTR lpszFontRes,
|
||||
LPCWSTR lpszFontFile,
|
||||
LPCWSTR lpszCurrentPath
|
||||
)
|
||||
{
|
||||
HANDLE f;
|
||||
|
||||
|
@ -253,13 +253,14 @@ CreateScalableFontResourceW(
|
|||
*/
|
||||
|
||||
/* If the output file already exists, return the ERROR_FILE_EXISTS error as specified in MSDN */
|
||||
if ((f = CreateFileW(lpszFontRes, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
|
||||
if ((f = CreateFileW(lpszFontRes, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(f);
|
||||
SetLastError(ERROR_FILE_EXISTS);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE; /* create failed */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -113,11 +113,11 @@ WINAPI
|
|||
ChoosePixelFormat(HDC hdc,
|
||||
CONST PIXELFORMATDESCRIPTOR * ppfd)
|
||||
{
|
||||
if (glChoosePixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
if (glChoosePixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
|
||||
return(glChoosePixelFormat(hdc, ppfd));
|
||||
return(glChoosePixelFormat(hdc, ppfd));
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,11 +132,11 @@ DescribePixelFormat(HDC hdc,
|
|||
UINT nBytes,
|
||||
LPPIXELFORMATDESCRIPTOR ppfd)
|
||||
{
|
||||
if (glDescribePixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
if (glDescribePixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
|
||||
return(glDescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd));
|
||||
return(glDescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd));
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,11 +148,11 @@ INT
|
|||
WINAPI
|
||||
GetPixelFormat(HDC hdc)
|
||||
{
|
||||
if (glGetPixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
if (glGetPixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
|
||||
return(glGetPixelFormat(hdc));
|
||||
return(glGetPixelFormat(hdc));
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,15 +166,15 @@ SetPixelFormat(HDC hdc,
|
|||
INT iPixelFormat,
|
||||
CONST PIXELFORMATDESCRIPTOR * ppfd)
|
||||
{
|
||||
/* Can only be set once */
|
||||
INT current = GetPixelFormat(hdc);
|
||||
if(current) return current == iPixelFormat ;
|
||||
|
||||
if (glSetPixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
/* Can only be set once */
|
||||
INT current = GetPixelFormat(hdc);
|
||||
if(current) return current == iPixelFormat ;
|
||||
|
||||
return(glSetPixelFormat(hdc, iPixelFormat, ppfd));
|
||||
if (glSetPixelFormat == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
|
||||
return(glSetPixelFormat(hdc, iPixelFormat, ppfd));
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,12 +186,12 @@ BOOL
|
|||
WINAPI
|
||||
SwapBuffers(HDC hdc)
|
||||
{
|
||||
if (glSwapBuffers == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
if (glSwapBuffers == NULL)
|
||||
if (OpenGLEnable() == FALSE)
|
||||
return(0);
|
||||
|
||||
|
||||
return(glSwapBuffers(hdc));
|
||||
return(glSwapBuffers(hdc));
|
||||
}
|
||||
|
||||
|
||||
|
@ -205,25 +205,25 @@ SwapBuffers(HDC hdc)
|
|||
UINT
|
||||
WINAPI
|
||||
GetEnhMetaFilePixelFormat(
|
||||
HENHMETAFILE hemf,
|
||||
UINT cbBuffer,
|
||||
PIXELFORMATDESCRIPTOR *ppfd
|
||||
)
|
||||
HENHMETAFILE hemf,
|
||||
UINT cbBuffer,
|
||||
PIXELFORMATDESCRIPTOR *ppfd
|
||||
)
|
||||
{
|
||||
ENHMETAHEADER pemh;
|
||||
ENHMETAHEADER pemh;
|
||||
|
||||
if(GetEnhMetaFileHeader(hemf, sizeof(ENHMETAHEADER), &pemh))
|
||||
{
|
||||
if(pemh.bOpenGL)
|
||||
{
|
||||
if(pemh.cbPixelFormat)
|
||||
{
|
||||
memcpy((void*)ppfd, UlongToPtr(pemh.offPixelFormat), cbBuffer );
|
||||
return(pemh.cbPixelFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
if(GetEnhMetaFileHeader(hemf, sizeof(ENHMETAHEADER), &pemh))
|
||||
{
|
||||
if(pemh.bOpenGL)
|
||||
{
|
||||
if(pemh.cbPixelFormat)
|
||||
{
|
||||
memcpy((void*)ppfd, UlongToPtr(pemh.offPixelFormat), cbBuffer );
|
||||
return(pemh.cbPixelFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -3,52 +3,52 @@
|
|||
BOOL
|
||||
WINAPI
|
||||
Arc(
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXStartArc,
|
||||
int nYStartArc,
|
||||
int nXEndArc,
|
||||
int nYEndArc
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXStartArc,
|
||||
int nYStartArc,
|
||||
int nXEndArc,
|
||||
int nYEndArc
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
// Call Wine (rewrite of) MFDRV_MetaParam8
|
||||
return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
// Call Wine (rewrite of) MFDRV_MetaParam8
|
||||
return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
// Call Wine (rewrite of) EMFDRV_ArcChordPie
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiArcInternal(GdiTypeArc,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXStartArc,
|
||||
nYStartArc,
|
||||
nXEndArc,
|
||||
nYEndArc);
|
||||
return NtGdiArcInternal(GdiTypeArc,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXStartArc,
|
||||
nYStartArc,
|
||||
nXEndArc,
|
||||
nYEndArc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,131 +64,131 @@ AngleArc(HDC hDC,
|
|||
FLOAT StartAngle,
|
||||
FLOAT SweepAngle)
|
||||
{
|
||||
gxf_long worker, worker1;
|
||||
gxf_long worker, worker1;
|
||||
|
||||
worker.f = StartAngle;
|
||||
worker1.f = SweepAngle;
|
||||
worker.f = StartAngle;
|
||||
worker1.f = SweepAngle;
|
||||
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return FALSE; //No meta support for AngleArc
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return FALSE; //No meta support for AngleArc
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l);
|
||||
return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l);
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
ArcTo(
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXRadial1,
|
||||
int nYRadial1,
|
||||
int nXRadial2,
|
||||
int nYRadial2)
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXRadial1,
|
||||
int nYRadial1,
|
||||
int nXRadial2,
|
||||
int nYRadial2)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return FALSE; //No meta support for ArcTo
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return FALSE; //No meta support for ArcTo
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiArcInternal(GdiTypeArcTo,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXRadial1,
|
||||
nYRadial1,
|
||||
nXRadial2,
|
||||
nYRadial2);
|
||||
return NtGdiArcInternal(GdiTypeArcTo,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXRadial1,
|
||||
nYRadial1,
|
||||
nXRadial2,
|
||||
nYRadial2);
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
Chord(
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXRadial1,
|
||||
int nYRadial1,
|
||||
int nXRadial2,
|
||||
int nYRadial2)
|
||||
HDC hDC,
|
||||
int nLeftRect,
|
||||
int nTopRect,
|
||||
int nRightRect,
|
||||
int nBottomRect,
|
||||
int nXRadial1,
|
||||
int nYRadial1,
|
||||
int nXRadial2,
|
||||
int nYRadial2)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiArcInternal(GdiTypeChord,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXRadial1,
|
||||
nYRadial1,
|
||||
nXRadial2,
|
||||
nYRadial2);
|
||||
return NtGdiArcInternal(GdiTypeChord,
|
||||
hDC,
|
||||
nLeftRect,
|
||||
nTopRect,
|
||||
nRightRect,
|
||||
nBottomRect,
|
||||
nXRadial1,
|
||||
nYRadial1,
|
||||
nXRadial2,
|
||||
nYRadial2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -198,41 +198,41 @@ Chord(
|
|||
BOOL
|
||||
WINAPI
|
||||
Pie(
|
||||
HDC hDC,
|
||||
int a1,
|
||||
int a2,
|
||||
int a3,
|
||||
int a4,
|
||||
int a5,
|
||||
int a6,
|
||||
int a7,
|
||||
int a8
|
||||
)
|
||||
HDC hDC,
|
||||
int a1,
|
||||
int a2,
|
||||
int a3,
|
||||
int a4,
|
||||
int a5,
|
||||
int a6,
|
||||
int a7,
|
||||
int a8
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE);
|
||||
return Ret;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,95 +16,95 @@ ExtCreatePen(DWORD dwPenStyle,
|
|||
DWORD dwStyleCount,
|
||||
CONST DWORD *lpStyle)
|
||||
{
|
||||
PVOID lpPackedDIB = NULL;
|
||||
HPEN hPen = NULL;
|
||||
PBITMAPINFO pConvertedInfo = NULL;
|
||||
UINT ConvertedInfoSize = 0, lbStyle;
|
||||
BOOL Hit = FALSE;
|
||||
PVOID lpPackedDIB = NULL;
|
||||
HPEN hPen = NULL;
|
||||
PBITMAPINFO pConvertedInfo = NULL;
|
||||
UINT ConvertedInfoSize = 0, lbStyle;
|
||||
BOOL Hit = FALSE;
|
||||
|
||||
if ((dwPenStyle & PS_STYLE_MASK) == PS_USERSTYLE)
|
||||
{
|
||||
if(!lpStyle)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
} // This is an enhancement and prevents a call to kernel space.
|
||||
else if ((dwPenStyle & PS_STYLE_MASK) == PS_INSIDEFRAME &&
|
||||
(dwPenStyle & PS_TYPE_MASK) != PS_GEOMETRIC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
else if ((dwPenStyle & PS_STYLE_MASK) == PS_ALTERNATE &&
|
||||
(dwPenStyle & PS_TYPE_MASK) != PS_COSMETIC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dwStyleCount || lpStyle)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if ((dwPenStyle & PS_STYLE_MASK) == PS_USERSTYLE)
|
||||
{
|
||||
if(!lpStyle)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
} // This is an enhancement and prevents a call to kernel space.
|
||||
else if ((dwPenStyle & PS_STYLE_MASK) == PS_INSIDEFRAME &&
|
||||
(dwPenStyle & PS_TYPE_MASK) != PS_GEOMETRIC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
else if ((dwPenStyle & PS_STYLE_MASK) == PS_ALTERNATE &&
|
||||
(dwPenStyle & PS_TYPE_MASK) != PS_COSMETIC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dwStyleCount || lpStyle)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
lbStyle = lplb->lbStyle;
|
||||
lbStyle = lplb->lbStyle;
|
||||
|
||||
if (lplb->lbStyle > BS_HATCHED)
|
||||
{
|
||||
if (lplb->lbStyle == BS_PATTERN)
|
||||
{
|
||||
pConvertedInfo = (PBITMAPINFO)lplb->lbHatch;
|
||||
if (!pConvertedInfo) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((lplb->lbStyle == BS_DIBPATTERN) || (lplb->lbStyle == BS_DIBPATTERNPT))
|
||||
{
|
||||
if (lplb->lbStyle == BS_DIBPATTERN)
|
||||
if (lplb->lbStyle > BS_HATCHED)
|
||||
{
|
||||
if (lplb->lbStyle == BS_PATTERN)
|
||||
{
|
||||
pConvertedInfo = (PBITMAPINFO)lplb->lbHatch;
|
||||
if (!pConvertedInfo) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((lplb->lbStyle == BS_DIBPATTERN) || (lplb->lbStyle == BS_DIBPATTERNPT))
|
||||
{
|
||||
lbStyle = BS_DIBPATTERNPT;
|
||||
lpPackedDIB = GlobalLock((HGLOBAL)lplb->lbHatch);
|
||||
if (lpPackedDIB == NULL) return 0;
|
||||
if (lplb->lbStyle == BS_DIBPATTERN)
|
||||
{
|
||||
lbStyle = BS_DIBPATTERNPT;
|
||||
lpPackedDIB = GlobalLock((HGLOBAL)lplb->lbHatch);
|
||||
if (lpPackedDIB == NULL) return 0;
|
||||
}
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB,
|
||||
lplb->lbColor,
|
||||
&ConvertedInfoSize,
|
||||
TRUE);
|
||||
Hit = TRUE; // We converted DIB.
|
||||
}
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB,
|
||||
lplb->lbColor,
|
||||
&ConvertedInfoSize,
|
||||
TRUE);
|
||||
Hit = TRUE; // We converted DIB.
|
||||
}
|
||||
else
|
||||
pConvertedInfo = (PBITMAPINFO)lpStyle;
|
||||
}
|
||||
}
|
||||
else
|
||||
pConvertedInfo = (PBITMAPINFO)lplb->lbHatch;
|
||||
|
||||
|
||||
hPen = NtGdiExtCreatePen(dwPenStyle,
|
||||
dwWidth,
|
||||
lbStyle,
|
||||
lplb->lbColor,
|
||||
lplb->lbHatch,
|
||||
(ULONG_PTR)pConvertedInfo,
|
||||
dwStyleCount,
|
||||
(PULONG)lpStyle,
|
||||
ConvertedInfoSize,
|
||||
FALSE,
|
||||
NULL);
|
||||
else
|
||||
pConvertedInfo = (PBITMAPINFO)lpStyle;
|
||||
}
|
||||
}
|
||||
else
|
||||
pConvertedInfo = (PBITMAPINFO)lplb->lbHatch;
|
||||
|
||||
|
||||
if (lplb->lbStyle == BS_DIBPATTERN) GlobalUnlock((HGLOBAL)lplb->lbHatch);
|
||||
hPen = NtGdiExtCreatePen(dwPenStyle,
|
||||
dwWidth,
|
||||
lbStyle,
|
||||
lplb->lbColor,
|
||||
lplb->lbHatch,
|
||||
(ULONG_PTR)pConvertedInfo,
|
||||
dwStyleCount,
|
||||
(PULONG)lpStyle,
|
||||
ConvertedInfoSize,
|
||||
FALSE,
|
||||
NULL);
|
||||
|
||||
if (Hit)
|
||||
{
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
return hPen;
|
||||
|
||||
if (lplb->lbStyle == BS_DIBPATTERN) GlobalUnlock((HGLOBAL)lplb->lbHatch);
|
||||
|
||||
if (Hit)
|
||||
{
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
return hPen;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -112,31 +112,31 @@ ExtCreatePen(DWORD dwPenStyle,
|
|||
*/
|
||||
HBRUSH WINAPI
|
||||
CreateDIBPatternBrush(
|
||||
HGLOBAL hglbDIBPacked,
|
||||
UINT fuColorSpec)
|
||||
HGLOBAL hglbDIBPacked,
|
||||
UINT fuColorSpec)
|
||||
{
|
||||
PVOID lpPackedDIB;
|
||||
HBRUSH hBrush = NULL;
|
||||
PBITMAPINFO pConvertedInfo;
|
||||
UINT ConvertedInfoSize;
|
||||
PVOID lpPackedDIB;
|
||||
HBRUSH hBrush = NULL;
|
||||
PBITMAPINFO pConvertedInfo;
|
||||
UINT ConvertedInfoSize;
|
||||
|
||||
lpPackedDIB = GlobalLock(hglbDIBPacked);
|
||||
if (lpPackedDIB == NULL)
|
||||
return 0;
|
||||
lpPackedDIB = GlobalLock(hglbDIBPacked);
|
||||
if (lpPackedDIB == NULL)
|
||||
return 0;
|
||||
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB, fuColorSpec,
|
||||
&ConvertedInfoSize, TRUE);
|
||||
if (pConvertedInfo)
|
||||
{
|
||||
hBrush = NtGdiCreateDIBBrush(pConvertedInfo, fuColorSpec,
|
||||
ConvertedInfoSize, FALSE, FALSE, lpPackedDIB);
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB, fuColorSpec,
|
||||
&ConvertedInfoSize, TRUE);
|
||||
if (pConvertedInfo)
|
||||
{
|
||||
hBrush = NtGdiCreateDIBBrush(pConvertedInfo, fuColorSpec,
|
||||
ConvertedInfoSize, FALSE, FALSE, lpPackedDIB);
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
|
||||
GlobalUnlock(hglbDIBPacked);
|
||||
GlobalUnlock(hglbDIBPacked);
|
||||
|
||||
return hBrush;
|
||||
return hBrush;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -144,27 +144,27 @@ CreateDIBPatternBrush(
|
|||
*/
|
||||
HBRUSH WINAPI
|
||||
CreateDIBPatternBrushPt(
|
||||
CONST VOID *lpPackedDIB,
|
||||
UINT fuColorSpec)
|
||||
CONST VOID *lpPackedDIB,
|
||||
UINT fuColorSpec)
|
||||
{
|
||||
HBRUSH hBrush = NULL;
|
||||
PBITMAPINFO pConvertedInfo;
|
||||
UINT ConvertedInfoSize;
|
||||
HBRUSH hBrush = NULL;
|
||||
PBITMAPINFO pConvertedInfo;
|
||||
UINT ConvertedInfoSize;
|
||||
|
||||
if (lpPackedDIB == NULL)
|
||||
return 0;
|
||||
if (lpPackedDIB == NULL)
|
||||
return 0;
|
||||
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB, fuColorSpec,
|
||||
&ConvertedInfoSize, TRUE);
|
||||
if (pConvertedInfo)
|
||||
{
|
||||
hBrush = NtGdiCreateDIBBrush(pConvertedInfo, fuColorSpec,
|
||||
ConvertedInfoSize, FALSE, FALSE, (PVOID)lpPackedDIB);
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
pConvertedInfo = ConvertBitmapInfo((PBITMAPINFO)lpPackedDIB, fuColorSpec,
|
||||
&ConvertedInfoSize, TRUE);
|
||||
if (pConvertedInfo)
|
||||
{
|
||||
hBrush = NtGdiCreateDIBBrush(pConvertedInfo, fuColorSpec,
|
||||
ConvertedInfoSize, FALSE, FALSE, (PVOID)lpPackedDIB);
|
||||
if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo)
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||
}
|
||||
|
||||
return hBrush;
|
||||
return hBrush;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -204,56 +204,56 @@ CreateSolidBrush(IN COLORREF crColor)
|
|||
*/
|
||||
HBRUSH WINAPI
|
||||
CreateBrushIndirect(
|
||||
CONST LOGBRUSH *LogBrush)
|
||||
CONST LOGBRUSH *LogBrush)
|
||||
{
|
||||
HBRUSH hBrush;
|
||||
HBRUSH hBrush;
|
||||
|
||||
switch (LogBrush->lbStyle)
|
||||
{
|
||||
case BS_DIBPATTERN8X8:
|
||||
case BS_DIBPATTERN:
|
||||
hBrush = CreateDIBPatternBrush((HGLOBAL)LogBrush->lbHatch,
|
||||
LogBrush->lbColor);
|
||||
break;
|
||||
switch (LogBrush->lbStyle)
|
||||
{
|
||||
case BS_DIBPATTERN8X8:
|
||||
case BS_DIBPATTERN:
|
||||
hBrush = CreateDIBPatternBrush((HGLOBAL)LogBrush->lbHatch,
|
||||
LogBrush->lbColor);
|
||||
break;
|
||||
|
||||
case BS_DIBPATTERNPT:
|
||||
hBrush = CreateDIBPatternBrushPt((PVOID)LogBrush->lbHatch,
|
||||
LogBrush->lbColor);
|
||||
break;
|
||||
case BS_DIBPATTERNPT:
|
||||
hBrush = CreateDIBPatternBrushPt((PVOID)LogBrush->lbHatch,
|
||||
LogBrush->lbColor);
|
||||
break;
|
||||
|
||||
case BS_PATTERN:
|
||||
hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch,
|
||||
FALSE,
|
||||
FALSE);
|
||||
break;
|
||||
case BS_PATTERN:
|
||||
hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch,
|
||||
FALSE,
|
||||
FALSE);
|
||||
break;
|
||||
|
||||
case BS_PATTERN8X8:
|
||||
hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch,
|
||||
FALSE,
|
||||
TRUE);
|
||||
break;
|
||||
case BS_PATTERN8X8:
|
||||
hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch,
|
||||
FALSE,
|
||||
TRUE);
|
||||
break;
|
||||
|
||||
case BS_SOLID:
|
||||
hBrush = NtGdiCreateSolidBrush(LogBrush->lbColor, 0);
|
||||
break;
|
||||
case BS_SOLID:
|
||||
hBrush = NtGdiCreateSolidBrush(LogBrush->lbColor, 0);
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
hBrush = NtGdiCreateHatchBrushInternal(LogBrush->lbHatch,
|
||||
LogBrush->lbColor,
|
||||
FALSE);
|
||||
break;
|
||||
case BS_HATCHED:
|
||||
hBrush = NtGdiCreateHatchBrushInternal(LogBrush->lbHatch,
|
||||
LogBrush->lbColor,
|
||||
FALSE);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
hBrush = NtGdiGetStockObject(NULL_BRUSH);
|
||||
break;
|
||||
case BS_NULL:
|
||||
hBrush = NtGdiGetStockObject(NULL_BRUSH);
|
||||
break;
|
||||
|
||||
default:
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
hBrush = NULL;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
hBrush = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return hBrush;
|
||||
return hBrush;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
@ -289,9 +289,9 @@ int
|
|||
WINAPI
|
||||
GetROP2(HDC hdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->jROP2;
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->jROP2;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -302,46 +302,46 @@ WINAPI
|
|||
SetROP2(HDC hdc,
|
||||
int fnDrawMode)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT Old_ROP2;
|
||||
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT Old_ROP2;
|
||||
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetROP2( hdc, fnDrawMode);
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetROP2(( hdc, fnDrawMode);
|
||||
}
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetROP2( hdc, fnDrawMode);
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetROP2(( hdc, fnDrawMode);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
|
||||
if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Old_ROP2 = Dc_Attr->jROP2;
|
||||
Dc_Attr->jROP2 = fnDrawMode;
|
||||
Old_ROP2 = Dc_Attr->jROP2;
|
||||
Dc_Attr->jROP2 = fnDrawMode;
|
||||
|
||||
return Old_ROP2;
|
||||
return Old_ROP2;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -352,15 +352,15 @@ BOOL
|
|||
WINAPI
|
||||
GetBrushOrgEx(HDC hdc,LPPOINT pt)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
if (pt)
|
||||
{
|
||||
pt->x = Dc_Attr->ptlBrushOrigin.x;
|
||||
pt->y = Dc_Attr->ptlBrushOrigin.y;
|
||||
}
|
||||
return TRUE;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
if (pt)
|
||||
{
|
||||
pt->x = Dc_Attr->ptlBrushOrigin.x;
|
||||
pt->y = Dc_Attr->ptlBrushOrigin.y;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -373,62 +373,62 @@ SetBrushOrgEx(HDC hdc,
|
|||
int nYOrg,
|
||||
LPPOINT lppt)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR Dc_Attr;
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( (pLDC == NULL) || (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC))
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( (pLDC == NULL) || (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetBrushOrg(hdc, nXOrg, nYOrg); // ReactOS only.
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetBrushOrg(hdc, nXOrg, nYOrg); // ReactOS only.
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
if (GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr))
|
||||
{
|
||||
PTEB pTeb = NtCurrentTeb();
|
||||
if (lppt)
|
||||
if (GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr))
|
||||
{
|
||||
lppt->x = Dc_Attr->ptlBrushOrigin.x;
|
||||
lppt->y = Dc_Attr->ptlBrushOrigin.y;
|
||||
PTEB pTeb = NtCurrentTeb();
|
||||
if (lppt)
|
||||
{
|
||||
lppt->x = Dc_Attr->ptlBrushOrigin.x;
|
||||
lppt->y = Dc_Attr->ptlBrushOrigin.y;
|
||||
}
|
||||
if ((nXOrg == Dc_Attr->ptlBrushOrigin.x) && (nYOrg == Dc_Attr->ptlBrushOrigin.y))
|
||||
return TRUE;
|
||||
|
||||
if(((pTeb->GdiTebBatch.HDC == NULL) || (pTeb->GdiTebBatch.HDC == hdc)) &&
|
||||
((pTeb->GdiTebBatch.Offset + sizeof(GDIBSSETBRHORG)) <= GDIBATCHBUFSIZE) &&
|
||||
(!(Dc_Attr->ulDirty_ & DC_DIBSECTION)) )
|
||||
{
|
||||
PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG)(&pTeb->GdiTebBatch.Buffer[0] +
|
||||
pTeb->GdiTebBatch.Offset);
|
||||
|
||||
Dc_Attr->ptlBrushOrigin.x = nXOrg;
|
||||
Dc_Attr->ptlBrushOrigin.y = nYOrg;
|
||||
|
||||
pgSBO->gbHdr.Cmd = GdiBCSetBrushOrg;
|
||||
pgSBO->gbHdr.Size = sizeof(GDIBSSETBRHORG);
|
||||
pgSBO->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
|
||||
|
||||
pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG);
|
||||
pTeb->GdiTebBatch.HDC = hdc;
|
||||
pTeb->GdiBatchCount++;
|
||||
DPRINT("Loading the Flush!! COUNT-> %d\n", pTeb->GdiBatchCount);
|
||||
|
||||
if (pTeb->GdiBatchCount >= GDI_BatchLimit)
|
||||
{
|
||||
DPRINT("Call GdiFlush!!\n");
|
||||
NtGdiFlush();
|
||||
DPRINT("Exit GdiFlush!!\n");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if ((nXOrg == Dc_Attr->ptlBrushOrigin.x) && (nYOrg == Dc_Attr->ptlBrushOrigin.y))
|
||||
return TRUE;
|
||||
|
||||
if(((pTeb->GdiTebBatch.HDC == NULL) || (pTeb->GdiTebBatch.HDC == hdc)) &&
|
||||
((pTeb->GdiTebBatch.Offset + sizeof(GDIBSSETBRHORG)) <= GDIBATCHBUFSIZE) &&
|
||||
(!(Dc_Attr->ulDirty_ & DC_DIBSECTION)) )
|
||||
{
|
||||
PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG)(&pTeb->GdiTebBatch.Buffer[0] +
|
||||
pTeb->GdiTebBatch.Offset);
|
||||
|
||||
Dc_Attr->ptlBrushOrigin.x = nXOrg;
|
||||
Dc_Attr->ptlBrushOrigin.y = nYOrg;
|
||||
|
||||
pgSBO->gbHdr.Cmd = GdiBCSetBrushOrg;
|
||||
pgSBO->gbHdr.Size = sizeof(GDIBSSETBRHORG);
|
||||
pgSBO->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
|
||||
|
||||
pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG);
|
||||
pTeb->GdiTebBatch.HDC = hdc;
|
||||
pTeb->GdiBatchCount++;
|
||||
DPRINT("Loading the Flush!! COUNT-> %d\n", pTeb->GdiBatchCount);
|
||||
|
||||
if (pTeb->GdiBatchCount >= GDI_BatchLimit)
|
||||
{
|
||||
DPRINT("Call GdiFlush!!\n");
|
||||
NtGdiFlush();
|
||||
DPRINT("Exit GdiFlush!!\n");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
|
||||
return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -156,16 +156,16 @@ EngGetCurrentCodePage( OUT PUSHORT OemCodePage,
|
|||
LPWSTR WINAPI
|
||||
EngGetDriverName(HDEV hdev)
|
||||
{
|
||||
// DHPDEV from NtGdiGetDhpdev must be from print driver.
|
||||
PUMPDEV pPDev = (PUMPDEV)NtGdiGetDhpdev(hdev);
|
||||
// DHPDEV from NtGdiGetDhpdev must be from print driver.
|
||||
PUMPDEV pPDev = (PUMPDEV)NtGdiGetDhpdev(hdev);
|
||||
|
||||
if (!pPDev) return NULL;
|
||||
|
||||
if (pPDev->Sig != PDEV_UMPD_ID)
|
||||
{
|
||||
pPDev = (PUMPDEV)pPDev->Sig;
|
||||
}
|
||||
return pPDev->pdi5Info->pDriverPath;
|
||||
if (!pPDev) return NULL;
|
||||
|
||||
if (pPDev->Sig != PDEV_UMPD_ID)
|
||||
{
|
||||
pPDev = (PUMPDEV)pPDev->Sig;
|
||||
}
|
||||
return pPDev->pdi5Info->pDriverPath;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -174,15 +174,15 @@ EngGetDriverName(HDEV hdev)
|
|||
LPWSTR WINAPI
|
||||
EngGetPrinterDataFileName(HDEV hdev)
|
||||
{
|
||||
PUMPDEV pPDev = (PUMPDEV)NtGdiGetDhpdev(hdev);
|
||||
PUMPDEV pPDev = (PUMPDEV)NtGdiGetDhpdev(hdev);
|
||||
|
||||
if (!pPDev) return NULL;
|
||||
if (!pPDev) return NULL;
|
||||
|
||||
if (pPDev->Sig != PDEV_UMPD_ID)
|
||||
{
|
||||
pPDev = (PUMPDEV)pPDev->Sig;
|
||||
}
|
||||
return pPDev->pdi5Info->pDataFile;
|
||||
if (pPDev->Sig != PDEV_UMPD_ID)
|
||||
{
|
||||
pPDev = (PUMPDEV)pPDev->Sig;
|
||||
}
|
||||
return pPDev->pdi5Info->pDataFile;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -191,7 +191,7 @@ EngGetPrinterDataFileName(HDEV hdev)
|
|||
HANDLE WINAPI
|
||||
EngLoadModule(LPWSTR pwsz)
|
||||
{
|
||||
return LoadLibraryExW ( pwsz, NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
return LoadLibraryExW ( pwsz, NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -204,7 +204,7 @@ EngMultiByteToWideChar(UINT CodePage,
|
|||
LPSTR MultiByteString,
|
||||
INT BytesInMultiByteString)
|
||||
{
|
||||
return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
|
||||
return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -213,16 +213,16 @@ EngMultiByteToWideChar(UINT CodePage,
|
|||
VOID WINAPI
|
||||
EngQueryLocalTime(PENG_TIME_FIELDS etf)
|
||||
{
|
||||
SYSTEMTIME SystemTime;
|
||||
GetLocalTime( &SystemTime );
|
||||
etf->usYear = SystemTime.wYear;
|
||||
etf->usMonth = SystemTime.wMonth;
|
||||
etf->usWeekday = SystemTime.wDayOfWeek;
|
||||
etf->usDay = SystemTime.wDay;
|
||||
etf->usHour = SystemTime.wHour;
|
||||
etf->usMinute = SystemTime.wMinute;
|
||||
etf->usSecond = SystemTime.wSecond;
|
||||
etf->usMilliseconds = SystemTime.wMilliseconds;
|
||||
SYSTEMTIME SystemTime;
|
||||
GetLocalTime( &SystemTime );
|
||||
etf->usYear = SystemTime.wYear;
|
||||
etf->usMonth = SystemTime.wMonth;
|
||||
etf->usWeekday = SystemTime.wDayOfWeek;
|
||||
etf->usDay = SystemTime.wDay;
|
||||
etf->usHour = SystemTime.wHour;
|
||||
etf->usMinute = SystemTime.wMinute;
|
||||
etf->usSecond = SystemTime.wSecond;
|
||||
etf->usMilliseconds = SystemTime.wMilliseconds;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -232,7 +232,7 @@ VOID
|
|||
WINAPI
|
||||
EngReleaseSemaphore ( IN HSEMAPHORE hsem )
|
||||
{
|
||||
RtlLeaveCriticalSection( (PRTL_CRITICAL_SECTION) hsem);
|
||||
RtlLeaveCriticalSection( (PRTL_CRITICAL_SECTION) hsem);
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,6 +249,6 @@ EngWideCharToMultiByte( UINT CodePage,
|
|||
LPSTR MultiByteString,
|
||||
INT BytesInMultiByteString)
|
||||
{
|
||||
return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
|
||||
MultiByteString, BytesInMultiByteString, NULL, NULL);
|
||||
return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
|
||||
MultiByteString, BytesInMultiByteString, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @unimplemented
|
||||
*/
|
||||
HENHMETAFILE
|
||||
WINAPI
|
||||
CloseEnhMetaFile(
|
||||
HDC hdc)
|
||||
HDC hdc)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ CreateEnhMetaFileW(
|
|||
LPCWSTR filename, /* [in] optional filename for disk metafiles */
|
||||
const RECT* rect, /* [in] optional bounding rectangle */
|
||||
LPCWSTR description /* [in] optional description */
|
||||
)
|
||||
)
|
||||
{
|
||||
HDC mDC;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
@ -40,8 +40,8 @@ CreateEnhMetaFileW(
|
|||
|
||||
if ( !GdiGetHandleUserData((HGDIOBJ) mDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr))
|
||||
{
|
||||
SetLastError (ERROR_INVALID_PARAMETER);
|
||||
return NULL; // need to delete the handle?
|
||||
SetLastError (ERROR_INVALID_PARAMETER);
|
||||
return NULL; // need to delete the handle?
|
||||
}
|
||||
|
||||
pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC));
|
||||
|
@ -51,8 +51,9 @@ CreateEnhMetaFileW(
|
|||
pLDC->iType = LDC_EMFDC
|
||||
|
||||
|
||||
if (description)
|
||||
{ /* App name\0Title\0\0 */
|
||||
if (description)
|
||||
{
|
||||
/* App name\0Title\0\0 */
|
||||
length = lstrlenW(description);
|
||||
length += lstrlenW(description + length + 1);
|
||||
length += 3;
|
||||
|
@ -96,7 +97,8 @@ CreateEnhMetaFileW(
|
|||
EmfDC->emf->rclFrame.bottom = rect->bottom;
|
||||
}
|
||||
else
|
||||
{ /* Set this to {0,0 - -1,-1} and update it at the end */
|
||||
{
|
||||
/* Set this to {0,0 - -1,-1} and update it at the end */
|
||||
EmfDC->emf->rclFrame.left = EmfDC->emf->rclFrame.top = 0;
|
||||
EmfDC->emf->rclFrame.right = EmfDC->emf->rclFrame.bottom = -1;
|
||||
}
|
||||
|
@ -131,7 +133,7 @@ CreateEnhMetaFileW(
|
|||
if (filename) /* disk based metafile */
|
||||
{
|
||||
if ((hFile = CreateFileW(filename, GENERIC_WRITE | GENERIC_READ, 0,
|
||||
NULL, CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
||||
NULL, CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
EMFDRV_DeleteDC( EmfDC );
|
||||
return NULL;
|
||||
|
@ -140,9 +142,9 @@ CreateEnhMetaFileW(
|
|||
{
|
||||
EMFDRV_DeleteDC( EmfDC );
|
||||
return NULL;
|
||||
}
|
||||
EmfDC.hFile = hFile;
|
||||
EmfDC.iType = METAFILE_DISK;
|
||||
}
|
||||
EmfDC.hFile = hFile;
|
||||
EmfDC.iType = METAFILE_DISK;
|
||||
}
|
||||
else
|
||||
EmfDC.iType = METAFILE_MEMORY;
|
||||
|
@ -158,23 +160,23 @@ CreateEnhMetaFileW(
|
|||
HENHMETAFILE
|
||||
WINAPI
|
||||
CopyEnhMetaFileA(
|
||||
HENHMETAFILE hemfSrc,
|
||||
LPCSTR lpszFile)
|
||||
HENHMETAFILE hemfSrc,
|
||||
LPCSTR lpszFile)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszFileW;
|
||||
HENHMETAFILE rc = 0;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszFileW;
|
||||
HENHMETAFILE rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = NULL;
|
||||
rc = NULL;
|
||||
|
||||
HEAP_free ( lpszFileW );
|
||||
HEAP_free ( lpszFileW );
|
||||
}
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -184,44 +186,44 @@ CopyEnhMetaFileA(
|
|||
HDC
|
||||
WINAPI
|
||||
CreateEnhMetaFileA(
|
||||
HDC hdcRef,
|
||||
LPCSTR lpFileName,
|
||||
CONST RECT *lpRect,
|
||||
LPCSTR lpDescription)
|
||||
HDC hdcRef,
|
||||
LPCSTR lpFileName,
|
||||
CONST RECT *lpRect,
|
||||
LPCSTR lpDescription)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpFileNameW, lpDescriptionW;
|
||||
HDC rc = 0;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpFileNameW, lpDescriptionW;
|
||||
HDC rc = 0;
|
||||
|
||||
lpFileNameW = NULL;
|
||||
if (lpFileName != NULL)
|
||||
{
|
||||
Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
lpFileNameW = NULL;
|
||||
if (lpFileName != NULL)
|
||||
{
|
||||
Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
|
||||
return rc;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
lpDescriptionW = NULL;
|
||||
if (lpDescription != NULL)
|
||||
{
|
||||
Status = HEAP_strdupA2W ( &lpDescriptionW, lpDescription );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
lpDescriptionW = NULL;
|
||||
if (lpDescription != NULL)
|
||||
{
|
||||
Status = HEAP_strdupA2W ( &lpDescriptionW, lpDescription );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
|
||||
return rc;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = NULL;
|
||||
rc = NULL;
|
||||
|
||||
if (lpDescriptionW != NULL)
|
||||
HEAP_free ( lpDescriptionW );
|
||||
if (lpDescriptionW != NULL)
|
||||
HEAP_free ( lpDescriptionW );
|
||||
|
||||
if (lpFileNameW != NULL)
|
||||
HEAP_free ( lpFileNameW );
|
||||
if (lpFileNameW != NULL)
|
||||
HEAP_free ( lpFileNameW );
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -229,201 +231,201 @@ CreateEnhMetaFileA(
|
|||
HDC
|
||||
WINAPI
|
||||
NtGdiCreateEnhMetaFile(HDC hDCRef,
|
||||
LPCWSTR File,
|
||||
CONST LPRECT Rect,
|
||||
LPCWSTR Description)
|
||||
LPCWSTR File,
|
||||
CONST LPRECT Rect,
|
||||
LPCWSTR Description)
|
||||
{
|
||||
PDC Dc;
|
||||
HDC ret = NULL;
|
||||
DWORD length = 0;
|
||||
HDC tempHDC;
|
||||
DWORD MemSize;
|
||||
DWORD dwDesiredAccess;
|
||||
PDC Dc;
|
||||
HDC ret = NULL;
|
||||
DWORD length = 0;
|
||||
HDC tempHDC;
|
||||
DWORD MemSize;
|
||||
DWORD dwDesiredAccess;
|
||||
|
||||
tempHDC = hDCRef;
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
/* FIXME ??
|
||||
* Shall we create hdc NtGdiHdcCompatible hdc ??
|
||||
*/
|
||||
UNICODE_STRING DriverName;
|
||||
RtlInitUnicodeString(&DriverName, L"DISPLAY");
|
||||
//IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
|
||||
tempHDC = NtGdiOpenDCW( &DriverName,
|
||||
NULL,
|
||||
NULL,
|
||||
0, // DCW 0 and ICW 1.
|
||||
NULL,
|
||||
(PVOID) NULL,
|
||||
(PVOID) NULL );
|
||||
}
|
||||
tempHDC = hDCRef;
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
/* FIXME ??
|
||||
* Shall we create hdc NtGdiHdcCompatible hdc ??
|
||||
*/
|
||||
UNICODE_STRING DriverName;
|
||||
RtlInitUnicodeString(&DriverName, L"DISPLAY");
|
||||
//IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
|
||||
tempHDC = NtGdiOpenDCW( &DriverName,
|
||||
NULL,
|
||||
NULL,
|
||||
0, // DCW 0 and ICW 1.
|
||||
NULL,
|
||||
(PVOID) NULL,
|
||||
(PVOID) NULL );
|
||||
}
|
||||
|
||||
GDIOBJ_SetOwnership(GdiHandleTable, tempHDC, PsGetCurrentProcess());
|
||||
DC_SetOwnership(tempHDC, PsGetCurrentProcess());
|
||||
GDIOBJ_SetOwnership(GdiHandleTable, tempHDC, PsGetCurrentProcess());
|
||||
DC_SetOwnership(tempHDC, PsGetCurrentProcess());
|
||||
|
||||
Dc = DC_LockDc(tempHDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
Dc = DC_LockDc(tempHDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(Description)
|
||||
{
|
||||
length = wcslen(Description);
|
||||
length += wcslen(Description + length + 1);
|
||||
length += 3;
|
||||
length *= 2;
|
||||
}
|
||||
if(Description)
|
||||
{
|
||||
length = wcslen(Description);
|
||||
length += wcslen(Description + length + 1);
|
||||
length += 3;
|
||||
length *= 2;
|
||||
}
|
||||
|
||||
MemSize = sizeof(ENHMETAHEADER) + (length + 3) / 4 * 4;
|
||||
MemSize = sizeof(ENHMETAHEADER) + (length + 3) / 4 * 4;
|
||||
|
||||
if (!(Dc->emh = EngAllocMem(FL_ZERO_MEMORY, MemSize, 0)))
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
if (!(Dc->emh = EngAllocMem(FL_ZERO_MEMORY, MemSize, 0)))
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Dc->emh->iType = EMR_HEADER;
|
||||
Dc->emh->nSize = MemSize;
|
||||
Dc->emh->iType = EMR_HEADER;
|
||||
Dc->emh->nSize = MemSize;
|
||||
|
||||
Dc->emh->rclBounds.left = Dc->emh->rclBounds.top = 0;
|
||||
Dc->emh->rclBounds.right = Dc->emh->rclBounds.bottom = -1;
|
||||
Dc->emh->rclBounds.left = Dc->emh->rclBounds.top = 0;
|
||||
Dc->emh->rclBounds.right = Dc->emh->rclBounds.bottom = -1;
|
||||
|
||||
if(Rect)
|
||||
{
|
||||
Dc->emh->rclFrame.left = Rect->left;
|
||||
Dc->emh->rclFrame.top = Rect->top;
|
||||
Dc->emh->rclFrame.right = Rect->right;
|
||||
Dc->emh->rclFrame.bottom = Rect->bottom;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set this to {0,0 - -1,-1} and update it at the end */
|
||||
Dc->emh->rclFrame.left = Dc->emh->rclFrame.top = 0;
|
||||
Dc->emh->rclFrame.right = Dc->emh->rclFrame.bottom = -1;
|
||||
}
|
||||
|
||||
Dc->emh->dSignature = ENHMETA_SIGNATURE;
|
||||
Dc->emh->nVersion = 0x10000;
|
||||
Dc->emh->nBytes = Dc->emh->nSize;
|
||||
Dc->emh->nRecords = 1;
|
||||
Dc->emh->nHandles = 1;
|
||||
|
||||
Dc->emh->sReserved = 0; /* According to docs, this is reserved and must be 0 */
|
||||
Dc->emh->nDescription = length / 2;
|
||||
|
||||
Dc->emh->offDescription = length ? sizeof(ENHMETAHEADER) : 0;
|
||||
|
||||
Dc->emh->nPalEntries = 0; /* I guess this should start at 0 */
|
||||
|
||||
/* Size in pixels */
|
||||
Dc->emh->szlDevice.cx = NtGdiGetDeviceCaps(tempHDC, HORZRES);
|
||||
Dc->emh->szlDevice.cy = NtGdiGetDeviceCaps(tempHDC, VERTRES);
|
||||
|
||||
/* Size in millimeters */
|
||||
Dc->emh->szlMillimeters.cx = NtGdiGetDeviceCaps(tempHDC, HORZSIZE);
|
||||
Dc->emh->szlMillimeters.cy = NtGdiGetDeviceCaps(tempHDC, VERTSIZE);
|
||||
|
||||
/* Size in micrometers */
|
||||
Dc->emh->szlMicrometers.cx = Dc->emh->szlMillimeters.cx * 1000;
|
||||
Dc->emh->szlMicrometers.cy = Dc->emh->szlMillimeters.cy * 1000;
|
||||
|
||||
if(Description)
|
||||
{
|
||||
memcpy((char *)Dc->emh + sizeof(ENHMETAHEADER), Description, length);
|
||||
}
|
||||
|
||||
ret = tempHDC;
|
||||
if (File)
|
||||
{
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
IO_STATUS_BLOCK Iosb;
|
||||
UNICODE_STRING NtPathU;
|
||||
NTSTATUS Status;
|
||||
ULONG FileAttributes = (FILE_ATTRIBUTE_VALID_FLAGS & ~FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
DPRINT1("Trying Create EnhMetaFile\n");
|
||||
|
||||
/* disk based metafile */
|
||||
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES;
|
||||
|
||||
if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
DPRINT1("Can not Create EnhMetaFile\n");
|
||||
SetLastWin32Error(ERROR_PATH_NOT_FOUND);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes, &NtPathU, 0, NULL, NULL);
|
||||
|
||||
Status = NtCreateFile (&Dc->hFile, dwDesiredAccess, &ObjectAttributes, &IoStatusBlock,
|
||||
NULL, FileAttributes, 0, FILE_OVERWRITE_IF, FILE_NON_DIRECTORY_FILE,
|
||||
NULL, 0);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Dc->hFile = NULL;
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
DPRINT1("Create EnhMetaFile fail\n");
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SetLastWin32Error(IoStatusBlock.Information == FILE_OVERWRITTEN ? ERROR_ALREADY_EXISTS : 0);
|
||||
|
||||
Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, Dc->emh->nSize, NULL, NULL);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
Status = NtWaitForSingleObject(Dc->hFile,FALSE,NULL);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = Iosb.Status;
|
||||
}
|
||||
}
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
ret = tempHDC;
|
||||
DC_UnlockDc(Dc);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dc->hFile = NULL;
|
||||
DPRINT1("Write to EnhMetaFile fail\n");
|
||||
SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
|
||||
ret = NULL;
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
}
|
||||
if(Rect)
|
||||
{
|
||||
Dc->emh->rclFrame.left = Rect->left;
|
||||
Dc->emh->rclFrame.top = Rect->top;
|
||||
Dc->emh->rclFrame.right = Rect->right;
|
||||
Dc->emh->rclFrame.bottom = Rect->bottom;
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
/* Set this to {0,0 - -1,-1} and update it at the end */
|
||||
Dc->emh->rclFrame.left = Dc->emh->rclFrame.top = 0;
|
||||
Dc->emh->rclFrame.right = Dc->emh->rclFrame.bottom = -1;
|
||||
}
|
||||
|
||||
Dc->emh->dSignature = ENHMETA_SIGNATURE;
|
||||
Dc->emh->nVersion = 0x10000;
|
||||
Dc->emh->nBytes = Dc->emh->nSize;
|
||||
Dc->emh->nRecords = 1;
|
||||
Dc->emh->nHandles = 1;
|
||||
|
||||
Dc->emh->sReserved = 0; /* According to docs, this is reserved and must be 0 */
|
||||
Dc->emh->nDescription = length / 2;
|
||||
|
||||
Dc->emh->offDescription = length ? sizeof(ENHMETAHEADER) : 0;
|
||||
|
||||
Dc->emh->nPalEntries = 0; /* I guess this should start at 0 */
|
||||
|
||||
/* Size in pixels */
|
||||
Dc->emh->szlDevice.cx = NtGdiGetDeviceCaps(tempHDC, HORZRES);
|
||||
Dc->emh->szlDevice.cy = NtGdiGetDeviceCaps(tempHDC, VERTRES);
|
||||
|
||||
/* Size in millimeters */
|
||||
Dc->emh->szlMillimeters.cx = NtGdiGetDeviceCaps(tempHDC, HORZSIZE);
|
||||
Dc->emh->szlMillimeters.cy = NtGdiGetDeviceCaps(tempHDC, VERTSIZE);
|
||||
|
||||
/* Size in micrometers */
|
||||
Dc->emh->szlMicrometers.cx = Dc->emh->szlMillimeters.cx * 1000;
|
||||
Dc->emh->szlMicrometers.cy = Dc->emh->szlMillimeters.cy * 1000;
|
||||
|
||||
if(Description)
|
||||
{
|
||||
memcpy((char *)Dc->emh + sizeof(ENHMETAHEADER), Description, length);
|
||||
}
|
||||
|
||||
ret = tempHDC;
|
||||
if (File)
|
||||
{
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
IO_STATUS_BLOCK Iosb;
|
||||
UNICODE_STRING NtPathU;
|
||||
NTSTATUS Status;
|
||||
ULONG FileAttributes = (FILE_ATTRIBUTE_VALID_FLAGS & ~FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
DPRINT1("Trying Create EnhMetaFile\n");
|
||||
|
||||
/* disk based metafile */
|
||||
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES;
|
||||
|
||||
if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
DPRINT1("Can not Create EnhMetaFile\n");
|
||||
SetLastWin32Error(ERROR_PATH_NOT_FOUND);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes, &NtPathU, 0, NULL, NULL);
|
||||
|
||||
Status = NtCreateFile (&Dc->hFile, dwDesiredAccess, &ObjectAttributes, &IoStatusBlock,
|
||||
NULL, FileAttributes, 0, FILE_OVERWRITE_IF, FILE_NON_DIRECTORY_FILE,
|
||||
NULL, 0);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Dc->hFile = NULL;
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
DPRINT1("Create EnhMetaFile fail\n");
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SetLastWin32Error(IoStatusBlock.Information == FILE_OVERWRITTEN ? ERROR_ALREADY_EXISTS : 0);
|
||||
|
||||
Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, Dc->emh->nSize, NULL, NULL);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
Status = NtWaitForSingleObject(Dc->hFile,FALSE,NULL);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = Iosb.Status;
|
||||
}
|
||||
}
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
ret = tempHDC;
|
||||
DC_UnlockDc(Dc);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dc->hFile = NULL;
|
||||
DPRINT1("Write to EnhMetaFile fail\n");
|
||||
SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
|
||||
ret = NULL;
|
||||
DC_UnlockDc(Dc);
|
||||
if (hDCRef == NULL)
|
||||
{
|
||||
NtGdiDeleteObjectApp(tempHDC);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -438,23 +440,23 @@ NtGdiCreateEnhMetaFile(HDC hDCRef,
|
|||
HENHMETAFILE
|
||||
WINAPI
|
||||
GetEnhMetaFileA(
|
||||
LPCSTR lpszMetaFile)
|
||||
LPCSTR lpszMetaFile)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszMetaFileW;
|
||||
HENHMETAFILE rc = 0;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszMetaFileW;
|
||||
HENHMETAFILE rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = NULL;
|
||||
Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = NULL;
|
||||
|
||||
HEAP_free ( lpszMetaFileW );
|
||||
}
|
||||
HEAP_free ( lpszMetaFileW );
|
||||
}
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -464,41 +466,41 @@ GetEnhMetaFileA(
|
|||
UINT
|
||||
WINAPI
|
||||
GetEnhMetaFileDescriptionA(
|
||||
HENHMETAFILE hemf,
|
||||
UINT cchBuffer,
|
||||
LPSTR lpszDescription)
|
||||
HENHMETAFILE hemf,
|
||||
UINT cchBuffer,
|
||||
LPSTR lpszDescription)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszDescriptionW;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszDescriptionW;
|
||||
|
||||
if ( lpszDescription && cchBuffer )
|
||||
if ( lpszDescription && cchBuffer )
|
||||
{
|
||||
lpszDescriptionW = (LPWSTR)HEAP_alloc ( cchBuffer*sizeof(WCHAR) );
|
||||
if ( !lpszDescriptionW )
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
|
||||
return 0;
|
||||
}
|
||||
lpszDescriptionW = (LPWSTR)HEAP_alloc ( cchBuffer*sizeof(WCHAR) );
|
||||
if ( !lpszDescriptionW )
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
lpszDescriptionW = NULL;
|
||||
else
|
||||
lpszDescriptionW = NULL;
|
||||
|
||||
if ( lpszDescription && cchBuffer )
|
||||
if ( lpszDescription && cchBuffer )
|
||||
{
|
||||
Status = RtlUnicodeToMultiByteN ( lpszDescription,
|
||||
cchBuffer,
|
||||
NULL,
|
||||
lpszDescriptionW,
|
||||
cchBuffer );
|
||||
HEAP_free ( lpszDescriptionW );
|
||||
if ( !NT_SUCCESS(Status) )
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
return 0;
|
||||
}
|
||||
Status = RtlUnicodeToMultiByteN ( lpszDescription,
|
||||
cchBuffer,
|
||||
NULL,
|
||||
lpszDescriptionW,
|
||||
cchBuffer );
|
||||
HEAP_free ( lpszDescriptionW );
|
||||
if ( !NT_SUCCESS(Status) )
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -508,44 +510,44 @@ GetEnhMetaFileDescriptionA(
|
|||
HENHMETAFILE
|
||||
WINAPI
|
||||
CopyEnhMetaFileW(
|
||||
HENHMETAFILE hemfSrc,
|
||||
LPCWSTR lpszFile)
|
||||
HENHMETAFILE hemfSrc,
|
||||
LPCWSTR lpszFile)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HENHMETAFILE
|
||||
WINAPI
|
||||
GetEnhMetaFileW(
|
||||
LPCWSTR lpszMetaFile)
|
||||
LPCWSTR lpszMetaFile)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
UINT
|
||||
WINAPI
|
||||
GetEnhMetaFileDescriptionW(
|
||||
HENHMETAFILE hemf,
|
||||
UINT cchBuffer,
|
||||
LPWSTR lpszDescription)
|
||||
HENHMETAFILE hemf,
|
||||
UINT cchBuffer,
|
||||
LPWSTR lpszDescription)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HDC
|
||||
WINAPI
|
||||
CreateEnhMetaFileW(
|
||||
HDC hdcRef,
|
||||
LPCWSTR lpFileName,
|
||||
LPCRECT lpRect,
|
||||
LPCWSTR lpDescription)
|
||||
HDC hdcRef,
|
||||
LPCWSTR lpFileName,
|
||||
LPCRECT lpRect,
|
||||
LPCWSTR lpDescription)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,22 +7,22 @@
|
|||
HCOLORSPACE
|
||||
FASTCALL
|
||||
IntCreateColorSpaceW(
|
||||
LPLOGCOLORSPACEW lplcpw,
|
||||
BOOL Ascii
|
||||
)
|
||||
LPLOGCOLORSPACEW lplcpw,
|
||||
BOOL Ascii
|
||||
)
|
||||
{
|
||||
LOGCOLORSPACEEXW lcpeexw;
|
||||
LOGCOLORSPACEEXW lcpeexw;
|
||||
|
||||
if ((lplcpw->lcsSignature != LCS_SIGNATURE) ||
|
||||
(lplcpw->lcsVersion != 0x400) ||
|
||||
(lplcpw->lcsSize != sizeof(LOGCOLORSPACEW)))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_COLORSPACE);
|
||||
return NULL;
|
||||
}
|
||||
RtlCopyMemory(&lcpeexw.lcsColorSpace, lplcpw, sizeof(LOGCOLORSPACEW));
|
||||
|
||||
return NtGdiCreateColorSpace(&lcpeexw);
|
||||
if ((lplcpw->lcsSignature != LCS_SIGNATURE) ||
|
||||
(lplcpw->lcsVersion != 0x400) ||
|
||||
(lplcpw->lcsSize != sizeof(LOGCOLORSPACEW)))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_COLORSPACE);
|
||||
return NULL;
|
||||
}
|
||||
RtlCopyMemory(&lcpeexw.lcsColorSpace, lplcpw, sizeof(LOGCOLORSPACEW));
|
||||
|
||||
return NtGdiCreateColorSpace(&lcpeexw);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -31,10 +31,10 @@ IntCreateColorSpaceW(
|
|||
HCOLORSPACE
|
||||
WINAPI
|
||||
CreateColorSpaceW(
|
||||
LPLOGCOLORSPACEW lplcpw
|
||||
)
|
||||
LPLOGCOLORSPACEW lplcpw
|
||||
)
|
||||
{
|
||||
return IntCreateColorSpaceW(lplcpw, FALSE);
|
||||
return IntCreateColorSpaceW(lplcpw, FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,36 +44,36 @@ CreateColorSpaceW(
|
|||
HCOLORSPACE
|
||||
WINAPI
|
||||
CreateColorSpaceA(
|
||||
LPLOGCOLORSPACEA lplcpa
|
||||
)
|
||||
LPLOGCOLORSPACEA lplcpa
|
||||
)
|
||||
{
|
||||
LOGCOLORSPACEW lcpw;
|
||||
LOGCOLORSPACEW lcpw;
|
||||
|
||||
if ((lplcpa->lcsSignature != LCS_SIGNATURE) ||
|
||||
(lplcpa->lcsVersion != 0x400) ||
|
||||
(lplcpa->lcsSize != sizeof(LOGCOLORSPACEA)))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_COLORSPACE);
|
||||
return NULL;
|
||||
}
|
||||
if ((lplcpa->lcsSignature != LCS_SIGNATURE) ||
|
||||
(lplcpa->lcsVersion != 0x400) ||
|
||||
(lplcpa->lcsSize != sizeof(LOGCOLORSPACEA)))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_COLORSPACE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lcpw.lcsSignature = lplcpa->lcsSignature;
|
||||
lcpw.lcsVersion = lplcpa->lcsVersion;
|
||||
lcpw.lcsSize = sizeof(LOGCOLORSPACEW);
|
||||
lcpw.lcsCSType = lplcpa->lcsCSType;
|
||||
lcpw.lcsIntent = lplcpa->lcsIntent;
|
||||
lcpw.lcsEndpoints = lplcpa->lcsEndpoints;
|
||||
lcpw.lcsGammaRed = lplcpa->lcsGammaRed;
|
||||
lcpw.lcsGammaGreen = lplcpa->lcsGammaGreen;
|
||||
lcpw.lcsGammaBlue = lplcpa->lcsGammaBlue;
|
||||
lcpw.lcsSignature = lplcpa->lcsSignature;
|
||||
lcpw.lcsVersion = lplcpa->lcsVersion;
|
||||
lcpw.lcsSize = sizeof(LOGCOLORSPACEW);
|
||||
lcpw.lcsCSType = lplcpa->lcsCSType;
|
||||
lcpw.lcsIntent = lplcpa->lcsIntent;
|
||||
lcpw.lcsEndpoints = lplcpa->lcsEndpoints;
|
||||
lcpw.lcsGammaRed = lplcpa->lcsGammaRed;
|
||||
lcpw.lcsGammaGreen = lplcpa->lcsGammaGreen;
|
||||
lcpw.lcsGammaBlue = lplcpa->lcsGammaBlue;
|
||||
|
||||
RtlMultiByteToUnicodeN( lcpw.lcsFilename,
|
||||
MAX_PATH,
|
||||
NULL,
|
||||
lplcpa->lcsFilename,
|
||||
strlen(lplcpa->lcsFilename) + 1);
|
||||
RtlMultiByteToUnicodeN( lcpw.lcsFilename,
|
||||
MAX_PATH,
|
||||
NULL,
|
||||
lplcpa->lcsFilename,
|
||||
strlen(lplcpa->lcsFilename) + 1);
|
||||
|
||||
return IntCreateColorSpaceW(&lcpw, FALSE);
|
||||
return IntCreateColorSpaceW(&lcpw, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -83,14 +83,14 @@ HCOLORSPACE
|
|||
WINAPI
|
||||
GetColorSpace(HDC hDC)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pDc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
return pDc_Attr->hColorSpace;
|
||||
if (!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
return pDc_Attr->hColorSpace;
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,31 +100,31 @@ GetColorSpace(HDC hDC)
|
|||
HCOLORSPACE
|
||||
WINAPI
|
||||
SetColorSpace(
|
||||
HDC hDC,
|
||||
HCOLORSPACE hCS
|
||||
)
|
||||
HDC hDC,
|
||||
HCOLORSPACE hCS
|
||||
)
|
||||
{
|
||||
HCOLORSPACE rhCS = GetColorSpace(hDC);
|
||||
HCOLORSPACE rhCS = GetColorSpace(hDC);
|
||||
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (NtGdiSetColorSpace(hDC, hCS)) return rhCS;
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (NtGdiSetColorSpace(hDC, hCS)) return rhCS;
|
||||
}
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_METADC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_METADC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hDC);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,9 @@ BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd,
|
|||
}
|
||||
if (dx > dy) /* line is "more horizontal" */
|
||||
{
|
||||
err = 2*dy - dx; erradd = 2*dy - 2*dx;
|
||||
for(cnt = 0;cnt < dx; cnt++)
|
||||
err = 2*dy - dx;
|
||||
erradd = 2*dy - 2*dx;
|
||||
for(cnt = 0; cnt < dx; cnt++)
|
||||
{
|
||||
callback(nXStart,nYStart,lParam);
|
||||
if (err > 0)
|
||||
|
@ -73,8 +74,9 @@ BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd,
|
|||
}
|
||||
else /* line is "more vertical" */
|
||||
{
|
||||
err = 2*dx - dy; erradd = 2*dx - 2*dy;
|
||||
for(cnt = 0;cnt < dy; cnt++)
|
||||
err = 2*dx - dy;
|
||||
erradd = 2*dx - 2*dy;
|
||||
for(cnt = 0; cnt < dy; cnt++)
|
||||
{
|
||||
callback(nXStart,nYStart,lParam);
|
||||
if (err > 0)
|
||||
|
|
|
@ -14,66 +14,66 @@ BOOL
|
|||
MF_CreateMFDC ( HGDIOBJ hMDC,
|
||||
PMETAFILEDC pmfDC )
|
||||
{
|
||||
PMF_ENTRY pMFME;
|
||||
PMF_ENTRY pMFME;
|
||||
|
||||
pMFME = LocalAlloc(LMEM_ZEROINIT, sizeof(MF_ENTRY));
|
||||
if (!pMFME)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
pMFME = LocalAlloc(LMEM_ZEROINIT, sizeof(MF_ENTRY));
|
||||
if (!pMFME)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (hMF_List == NULL)
|
||||
{
|
||||
hMF_List = pMFME;
|
||||
InitializeListHead(&hMF_List->List);
|
||||
}
|
||||
else
|
||||
InsertTailList(&hMF_List->List, &pMFME->List);
|
||||
if (hMF_List == NULL)
|
||||
{
|
||||
hMF_List = pMFME;
|
||||
InitializeListHead(&hMF_List->List);
|
||||
}
|
||||
else
|
||||
InsertTailList(&hMF_List->List, &pMFME->List);
|
||||
|
||||
pMFME->hmDC = hMDC;
|
||||
pMFME->pmfDC = pmfDC;
|
||||
pMFME->hmDC = hMDC;
|
||||
pMFME->pmfDC = pmfDC;
|
||||
|
||||
hMFCount++;
|
||||
return TRUE;
|
||||
hMFCount++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
PMETAFILEDC
|
||||
MF_GetMFDC ( HGDIOBJ hMDC )
|
||||
{
|
||||
PMF_ENTRY pMFME = hMF_List;
|
||||
PMF_ENTRY pMFME = hMF_List;
|
||||
|
||||
do
|
||||
{
|
||||
if ( pMFME->hmDC == hMDC ) return pMFME->pmfDC;
|
||||
pMFME = (PMF_ENTRY) pMFME->List.Flink;
|
||||
}
|
||||
while ( pMFME != hMF_List );
|
||||
do
|
||||
{
|
||||
if ( pMFME->hmDC == hMDC ) return pMFME->pmfDC;
|
||||
pMFME = (PMF_ENTRY) pMFME->List.Flink;
|
||||
}
|
||||
while ( pMFME != hMF_List );
|
||||
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
MF_DeleteMFDC ( HGDIOBJ hMDC )
|
||||
{
|
||||
PMF_ENTRY pMFME = hMF_List;
|
||||
PMF_ENTRY pMFME = hMF_List;
|
||||
|
||||
do
|
||||
{
|
||||
if ( pMFME->hmDC == hMDC)
|
||||
do
|
||||
{
|
||||
RemoveEntryList(&pMFME->List);
|
||||
LocalFree ( pMFME );
|
||||
hMFCount--;
|
||||
if (!hMFCount) hMF_List = NULL;
|
||||
return TRUE;
|
||||
if ( pMFME->hmDC == hMDC)
|
||||
{
|
||||
RemoveEntryList(&pMFME->List);
|
||||
LocalFree ( pMFME );
|
||||
hMFCount--;
|
||||
if (!hMFCount) hMF_List = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
pMFME = (PMF_ENTRY) pMFME->List.Flink;
|
||||
}
|
||||
pMFME = (PMF_ENTRY) pMFME->List.Flink;
|
||||
}
|
||||
while ( pMFME != hMF_List );
|
||||
while ( pMFME != hMF_List );
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
@ -84,10 +84,10 @@ MF_DeleteMFDC ( HGDIOBJ hMDC )
|
|||
HMETAFILE
|
||||
WINAPI
|
||||
CloseMetaFile(
|
||||
HDC a0
|
||||
)
|
||||
HDC a0
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,11 +97,11 @@ CloseMetaFile(
|
|||
HMETAFILE
|
||||
WINAPI
|
||||
CopyMetaFileW(
|
||||
HMETAFILE hmfSrc,
|
||||
LPCWSTR lpszFile
|
||||
)
|
||||
HMETAFILE hmfSrc,
|
||||
LPCWSTR lpszFile
|
||||
)
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,24 +111,24 @@ CopyMetaFileW(
|
|||
HMETAFILE
|
||||
WINAPI
|
||||
CopyMetaFileA(
|
||||
HMETAFILE hmfSrc,
|
||||
LPCSTR lpszFile
|
||||
)
|
||||
HMETAFILE hmfSrc,
|
||||
LPCSTR lpszFile
|
||||
)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PWSTR lpszFileW;
|
||||
HMETAFILE rc = 0;
|
||||
NTSTATUS Status;
|
||||
PWSTR lpszFileW;
|
||||
HMETAFILE rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = CopyMetaFileW( hmfSrc, lpszFileW );
|
||||
HEAP_free ( lpszFileW );
|
||||
}
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = CopyMetaFileW( hmfSrc, lpszFileW );
|
||||
HEAP_free ( lpszFileW );
|
||||
}
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,59 +138,59 @@ CopyMetaFileA(
|
|||
HDC
|
||||
WINAPI
|
||||
CreateMetaFileW(
|
||||
LPCWSTR lpszFile
|
||||
)
|
||||
LPCWSTR lpszFile
|
||||
)
|
||||
{
|
||||
HANDLE hFile;
|
||||
HDC hmDC;
|
||||
PMETAFILEDC pmfDC = LocalAlloc(LMEM_ZEROINIT, sizeof(METAFILEDC));
|
||||
if (!pmfDC) return NULL;
|
||||
HANDLE hFile;
|
||||
HDC hmDC;
|
||||
PMETAFILEDC pmfDC = LocalAlloc(LMEM_ZEROINIT, sizeof(METAFILEDC));
|
||||
if (!pmfDC) return NULL;
|
||||
|
||||
pmfDC->mh.mtHeaderSize = sizeof(METAHEADER) / sizeof(WORD);
|
||||
pmfDC->mh.mtVersion = 0x0300;
|
||||
pmfDC->mh.mtSize = pmfDC->mh.mtHeaderSize;
|
||||
pmfDC->mh.mtHeaderSize = sizeof(METAHEADER) / sizeof(WORD);
|
||||
pmfDC->mh.mtVersion = 0x0300;
|
||||
pmfDC->mh.mtSize = pmfDC->mh.mtHeaderSize;
|
||||
|
||||
pmfDC->hPen = GetStockObject(BLACK_PEN);
|
||||
pmfDC->hBrush = GetStockObject(WHITE_BRUSH);
|
||||
pmfDC->hFont = GetStockObject(DEVICE_DEFAULT_FONT);
|
||||
pmfDC->hBitmap = GetStockObject(DEFAULT_BITMAP);
|
||||
pmfDC->hPalette = GetStockObject(DEFAULT_PALETTE);
|
||||
pmfDC->hPen = GetStockObject(BLACK_PEN);
|
||||
pmfDC->hBrush = GetStockObject(WHITE_BRUSH);
|
||||
pmfDC->hFont = GetStockObject(DEVICE_DEFAULT_FONT);
|
||||
pmfDC->hBitmap = GetStockObject(DEFAULT_BITMAP);
|
||||
pmfDC->hPalette = GetStockObject(DEFAULT_PALETTE);
|
||||
|
||||
if (lpszFile) /* disk based metafile */
|
||||
{
|
||||
pmfDC->mh.mtType = METAFILE_DISK;
|
||||
|
||||
if(!GetFullPathName( lpszFile,
|
||||
MAX_PATH,
|
||||
(LPTSTR) &pmfDC->Filename,
|
||||
(LPTSTR*) &lpszFile))
|
||||
if (lpszFile) /* disk based metafile */
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
pmfDC->mh.mtType = METAFILE_DISK;
|
||||
|
||||
if(!GetFullPathName( lpszFile,
|
||||
MAX_PATH,
|
||||
(LPTSTR) &pmfDC->Filename,
|
||||
(LPTSTR*) &lpszFile))
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((hFile = CreateFileW(pmfDC->Filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh), &pmfDC->dwWritten, NULL ))
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
}
|
||||
pmfDC->hFile = hFile;
|
||||
}
|
||||
else /* memory based metafile */
|
||||
pmfDC->mh.mtType = METAFILE_MEMORY;
|
||||
|
||||
if ((hFile = CreateFileW(pmfDC->Filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
}
|
||||
hmDC = NtGdiCreateClientObj ( GDI_OBJECT_TYPE_METADC );
|
||||
|
||||
if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh), &pmfDC->dwWritten, NULL ))
|
||||
{
|
||||
LocalFree(pmfDC);
|
||||
return NULL;
|
||||
}
|
||||
pmfDC->hFile = hFile;
|
||||
}
|
||||
else /* memory based metafile */
|
||||
pmfDC->mh.mtType = METAFILE_MEMORY;
|
||||
MF_CreateMFDC ( hmDC, pmfDC );
|
||||
|
||||
hmDC = NtGdiCreateClientObj ( GDI_OBJECT_TYPE_METADC );
|
||||
|
||||
MF_CreateMFDC ( hmDC, pmfDC );
|
||||
|
||||
return hmDC;
|
||||
return hmDC;
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,22 +200,22 @@ CreateMetaFileW(
|
|||
HDC
|
||||
WINAPI
|
||||
CreateMetaFileA(
|
||||
LPCSTR lpszFile
|
||||
)
|
||||
LPCSTR lpszFile
|
||||
)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PWSTR lpszFileW;
|
||||
HDC rc = 0;
|
||||
NTSTATUS Status;
|
||||
PWSTR lpszFileW;
|
||||
HDC rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = CreateMetaFileW( lpszFileW );
|
||||
HEAP_free ( lpszFileW );
|
||||
rc = CreateMetaFileW( lpszFileW );
|
||||
HEAP_free ( lpszFileW );
|
||||
}
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -225,10 +225,10 @@ CreateMetaFileA(
|
|||
BOOL
|
||||
WINAPI
|
||||
DeleteMetaFile(
|
||||
HMETAFILE a0
|
||||
)
|
||||
HMETAFILE a0
|
||||
)
|
||||
{
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,10 +238,10 @@ DeleteMetaFile(
|
|||
HMETAFILE
|
||||
WINAPI
|
||||
GetMetaFileW(
|
||||
LPCWSTR lpszMetaFile
|
||||
)
|
||||
LPCWSTR lpszMetaFile
|
||||
)
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -251,23 +251,23 @@ GetMetaFileW(
|
|||
HMETAFILE
|
||||
WINAPI
|
||||
GetMetaFileA(
|
||||
LPCSTR lpszMetaFile
|
||||
)
|
||||
LPCSTR lpszMetaFile
|
||||
)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszMetaFileW;
|
||||
HMETAFILE rc = 0;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszMetaFileW;
|
||||
HMETAFILE rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = GetMetaFileW( lpszMetaFileW );
|
||||
HEAP_free ( lpszMetaFileW );
|
||||
rc = GetMetaFileW( lpszMetaFileW );
|
||||
HEAP_free ( lpszMetaFileW );
|
||||
}
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -104,10 +104,10 @@ GetSystemPaletteEntries(HDC hDC,
|
|||
RtlCopyMemory(ippe, sys_pal_template, 10 * sizeof(PALETTEENTRY));
|
||||
RtlCopyMemory(&ippe[246], &sys_pal_template[10], 10 * sizeof(PALETTEENTRY));
|
||||
RtlZeroMemory(&ippe[10], sizeof(ippe) - 20 * sizeof(PALETTEENTRY));
|
||||
|
||||
|
||||
if (iStartIndex < 256)
|
||||
{
|
||||
RtlCopyMemory(ppe,
|
||||
RtlCopyMemory(ppe,
|
||||
&ippe[iStartIndex],
|
||||
min(256 - iStartIndex, cEntries) *
|
||||
sizeof(PALETTEENTRY));
|
||||
|
@ -125,9 +125,9 @@ GetDIBColorTable(HDC hDC,
|
|||
UINT cEntries,
|
||||
RGBQUAD *pColors)
|
||||
{
|
||||
if (cEntries)
|
||||
return NtGdiDoPalette(hDC, iStartIndex, cEntries, pColors, GdiPalGetColorTable, FALSE);
|
||||
return 0;
|
||||
if (cEntries)
|
||||
return NtGdiDoPalette(hDC, iStartIndex, cEntries, pColors, GdiPalGetColorTable, FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -139,21 +139,21 @@ RealizePalette(HDC hDC) /* [in] Handle of device context */
|
|||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_(hDC);
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
HPALETTE Pal = GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE);
|
||||
PLDC pLDC = GdiGetLDC((HDC) Pal);
|
||||
if ( !pLDC ) return FALSE;
|
||||
if (pLDC->iType == LDC_EMFLDC) return EMFDRV_(Pal);
|
||||
return FALSE;
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_(hDC);
|
||||
else
|
||||
{
|
||||
HPALETTE Pal = GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE);
|
||||
PLDC pLDC = GdiGetLDC((HDC) Pal);
|
||||
if ( !pLDC ) return FALSE;
|
||||
if (pLDC->iType == LDC_EMFLDC) return EMFDRV_(Pal);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return UserRealizePalette(hDC);
|
||||
return UserRealizePalette(hDC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -162,11 +162,11 @@ RealizePalette(HDC hDC) /* [in] Handle of device context */
|
|||
BOOL
|
||||
WINAPI
|
||||
ResizePalette(
|
||||
HPALETTE hPalette,
|
||||
UINT nEntries
|
||||
)
|
||||
HPALETTE hPalette,
|
||||
UINT nEntries
|
||||
)
|
||||
{
|
||||
return NtGdiResizePalette(hPalette, nEntries);
|
||||
return NtGdiResizePalette(hPalette, nEntries);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -195,11 +195,11 @@ SetDIBColorTable(HDC hDC,
|
|||
BOOL
|
||||
WINAPI
|
||||
UpdateColors(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
return NtGdiUpdateColors(hdc);
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
return NtGdiUpdateColors(hdc);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
BOOL
|
||||
WINAPI
|
||||
AbortPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiAbortPath( hdc );
|
||||
return NtGdiAbortPath( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,10 +30,10 @@ AbortPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
BeginPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiBeginPath( hdc );
|
||||
return NtGdiBeginPath( hdc );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -42,10 +42,10 @@ BeginPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
CloseFigure(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiCloseFigure ( hdc );
|
||||
return NtGdiCloseFigure ( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,10 +55,10 @@ CloseFigure(
|
|||
BOOL
|
||||
WINAPI
|
||||
EndPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiEndPath( hdc );
|
||||
return NtGdiEndPath( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,10 +68,10 @@ EndPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
FillPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiFillPath( hdc );
|
||||
return NtGdiFillPath( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,10 +81,10 @@ FillPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
FlattenPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiFlattenPath ( hdc );
|
||||
return NtGdiFlattenPath ( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,10 +119,10 @@ GetPath(HDC hdc,
|
|||
HRGN
|
||||
WINAPI
|
||||
PathToRegion(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiPathToRegion ( hdc );
|
||||
return NtGdiPathToRegion ( hdc );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -131,18 +131,18 @@ PathToRegion(
|
|||
BOOL
|
||||
WINAPI
|
||||
SetMiterLimit(
|
||||
HDC hdc,
|
||||
FLOAT a1,
|
||||
PFLOAT a2
|
||||
)
|
||||
HDC hdc,
|
||||
FLOAT a1,
|
||||
PFLOAT a2
|
||||
)
|
||||
{
|
||||
BOOL Ret;
|
||||
gxf_long worker, worker1;
|
||||
BOOL Ret;
|
||||
gxf_long worker, worker1;
|
||||
|
||||
worker.f = a1;
|
||||
Ret = NtGdiSetMiterLimit ( hdc, worker.l, a2 ? &worker1.l : NULL );
|
||||
if (a2 && Ret) *a2 = worker1.f;
|
||||
return Ret;
|
||||
worker.f = a1;
|
||||
Ret = NtGdiSetMiterLimit ( hdc, worker.l, a2 ? &worker1.l : NULL );
|
||||
if (a2 && Ret) *a2 = worker1.f;
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,10 +152,10 @@ SetMiterLimit(
|
|||
BOOL
|
||||
WINAPI
|
||||
StrokeAndFillPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiStrokeAndFillPath ( hdc );
|
||||
return NtGdiStrokeAndFillPath ( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,10 +165,10 @@ StrokeAndFillPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
StrokePath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiStrokePath ( hdc );
|
||||
return NtGdiStrokePath ( hdc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,10 +178,10 @@ StrokePath(
|
|||
BOOL
|
||||
WINAPI
|
||||
WidenPath(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
return NtGdiWidenPath ( hdc );
|
||||
return NtGdiWidenPath ( hdc );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -190,9 +190,9 @@ WidenPath(
|
|||
BOOL
|
||||
WINAPI
|
||||
SelectClipPath(
|
||||
HDC hdc,
|
||||
int Mode
|
||||
)
|
||||
HDC hdc,
|
||||
int Mode
|
||||
)
|
||||
{
|
||||
return NtGdiSelectClipPath ( hdc, Mode );
|
||||
return NtGdiSelectClipPath ( hdc, Mode );
|
||||
}
|
||||
|
|
|
@ -26,8 +26,8 @@ CreatePen(
|
|||
/* FIXME Some part need be done in user mode */
|
||||
if (nPenStyle > PS_DASHDOTDOT)
|
||||
{
|
||||
if (nPenStyle == PS_NULL) return GetStockObject(NULL_PEN);
|
||||
if (nPenStyle != PS_INSIDEFRAME) nPenStyle = PS_SOLID;
|
||||
if (nPenStyle == PS_NULL) return GetStockObject(NULL_PEN);
|
||||
if (nPenStyle != PS_INSIDEFRAME) nPenStyle = PS_SOLID;
|
||||
}
|
||||
return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
|
||||
}
|
||||
|
|
|
@ -71,68 +71,68 @@ static
|
|||
int
|
||||
FASTCALL
|
||||
IntEndPage(
|
||||
HDC hdc,
|
||||
BOOL Form
|
||||
)
|
||||
HDC hdc,
|
||||
BOOL Form
|
||||
)
|
||||
{
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_ATENDPAGE) return 1;
|
||||
if (pldc->Flags & LDC_ATENDPAGE) return 1;
|
||||
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
if ( Form )
|
||||
{
|
||||
// Do MF EndPageForm
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do MF EndPage
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
if ( Form )
|
||||
{
|
||||
// Do MF EndPageForm
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do MF EndPage
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_KILL_DOCUMENT || pldc->Flags & LDC_INIT_PAGE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (pldc->Flags & LDC_KILL_DOCUMENT || pldc->Flags & LDC_INIT_PAGE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
|
||||
if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
|
||||
|
||||
pldc->Flags &= ~LDC_INIT_PAGE;
|
||||
pldc->Flags &= ~LDC_INIT_PAGE;
|
||||
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDPAGE, 0, NULL, 0, NULL);
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDPAGE, 0, NULL, 0, NULL);
|
||||
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
|
||||
if ( NtGdiEndPage(hdc) )
|
||||
{
|
||||
BOOL Good;
|
||||
if ( NtGdiEndPage(hdc) )
|
||||
{
|
||||
BOOL Good;
|
||||
// if (pldc->pUMPDev)
|
||||
Good = EndPagePrinterEx(NULL,pldc->hPrinter);
|
||||
Good = EndPagePrinterEx(NULL,pldc->hPrinter);
|
||||
|
||||
if (Good) pldc->Flags |= LDC_STARTPAGE;
|
||||
Ret = 1;
|
||||
}
|
||||
else
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return Ret;
|
||||
if (Good) pldc->Flags |= LDC_STARTPAGE;
|
||||
Ret = 1;
|
||||
}
|
||||
else
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
@ -140,9 +140,9 @@ IntEndPage(
|
|||
BOOL
|
||||
FASTCALL
|
||||
AbortPrinterEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
{
|
||||
return fpAbortPrinter(hPrinter);
|
||||
}
|
||||
|
@ -150,15 +150,15 @@ AbortPrinterEx(
|
|||
int
|
||||
FASTCALL
|
||||
DocumentEventEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter,
|
||||
HDC hdc,
|
||||
int iEsc,
|
||||
ULONG cbIn,
|
||||
PVOID pvIn,
|
||||
ULONG cbOut,
|
||||
PVOID pvOut
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter,
|
||||
HDC hdc,
|
||||
int iEsc,
|
||||
ULONG cbIn,
|
||||
PVOID pvIn,
|
||||
ULONG cbOut,
|
||||
PVOID pvOut
|
||||
)
|
||||
{
|
||||
return fpDocumentEvent(hPrinter,hdc,iEsc,cbIn,pvIn,cbOut,pvOut);
|
||||
}
|
||||
|
@ -166,9 +166,9 @@ DocumentEventEx(
|
|||
BOOL
|
||||
FASTCALL
|
||||
EndDocPrinterEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
{
|
||||
return fpEndDocPrinter(hPrinter);
|
||||
}
|
||||
|
@ -176,91 +176,91 @@ EndDocPrinterEx(
|
|||
BOOL
|
||||
FASTCALL
|
||||
EndPagePrinterEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
{
|
||||
return fpEndPagePrinter(hPrinter);
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
FASTCALL
|
||||
LoadTheSpoolerDrv(VOID)
|
||||
{
|
||||
HMODULE hModWinSpoolDrv;
|
||||
HMODULE hModWinSpoolDrv;
|
||||
|
||||
if ( !ghSpooler )
|
||||
{
|
||||
RtlEnterCriticalSection(&semLocal);
|
||||
if ( !ghSpooler )
|
||||
{
|
||||
RtlEnterCriticalSection(&semLocal);
|
||||
|
||||
hModWinSpoolDrv = LoadLibraryW(L"WINSPOOL.DRV");
|
||||
hModWinSpoolDrv = LoadLibraryW(L"WINSPOOL.DRV");
|
||||
|
||||
if (hModWinSpoolDrv)
|
||||
{
|
||||
fpAbortPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "AbortPrinter");
|
||||
fpClosePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ClosePrinter");
|
||||
fpCloseSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "CloseSpoolFileHandle");
|
||||
fpCommitSpoolData = (PVOID)GetProcAddress(hModWinSpoolDrv, "CommitSpoolData");
|
||||
// fpConnectToLd64In32Server = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)224);
|
||||
fpDocumentEvent = (PVOID)GetProcAddress(hModWinSpoolDrv,"DocumentEvent");
|
||||
fpDocumentPropertiesW = (PVOID)GetProcAddress(hModWinSpoolDrv, "DocumentPropertiesW");
|
||||
fpEndDocPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndDocPrinter");
|
||||
fpEndPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndPagePrinter");
|
||||
fpGetPrinterW = (PVOID)GetProcAddress( hModWinSpoolDrv,"GetPrinterW");
|
||||
fpGetPrinterDriverW = (PVOID)GetProcAddress(hModWinSpoolDrv,"GetPrinterDriverW");
|
||||
fpGetSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "GetSpoolFileHandle");
|
||||
fpIsValidDevmodeW = (PVOID)GetProcAddress(hModWinSpoolDrv, "IsValidDevmodeW");
|
||||
fpOpenPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "OpenPrinterW");
|
||||
fpQueryColorProfile = (PVOID)GetProcAddress(hModWinSpoolDrv,"QueryColorProfile");
|
||||
fpQueryRemoteFonts = (PVOID)GetProcAddress(hModWinSpoolDrv, "QueryRemoteFonts");
|
||||
fpQuerySpoolMode = (PVOID)GetProcAddress(hModWinSpoolDrv, "QuerySpoolMode");
|
||||
fpReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ReadPrinter");
|
||||
fpResetPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "ResetPrinterW");
|
||||
fpSeekPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "SeekPrinter");
|
||||
fpSplDriverUnloadComplete = (PVOID)GetProcAddress(hModWinSpoolDrv, "SplDriverUnloadComplete");
|
||||
fpSplReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)205);
|
||||
fpStartDocDlgW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocDlgW");
|
||||
fpStartDocPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocPrinterW");
|
||||
fpStartPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartPagePrinter");
|
||||
|
||||
if ( !fpAbortPrinter ||
|
||||
!fpClosePrinter ||
|
||||
!fpCloseSpoolFileHandle ||
|
||||
!fpCommitSpoolData ||
|
||||
!fpDocumentEvent ||
|
||||
!fpDocumentPropertiesW ||
|
||||
!fpEndDocPrinter ||
|
||||
!fpEndPagePrinter ||
|
||||
!fpGetPrinterW ||
|
||||
!fpGetPrinterDriverW ||
|
||||
!fpGetSpoolFileHandle ||
|
||||
!fpIsValidDevmodeW ||
|
||||
!fpOpenPrinterW ||
|
||||
!fpQueryColorProfile ||
|
||||
!fpQueryRemoteFonts ||
|
||||
!fpQuerySpoolMode ||
|
||||
!fpReadPrinter ||
|
||||
!fpResetPrinterW ||
|
||||
!fpSeekPrinter ||
|
||||
!fpSplDriverUnloadComplete ||
|
||||
!fpSplReadPrinter ||
|
||||
!fpStartDocDlgW ||
|
||||
!fpStartDocPrinterW ||
|
||||
!fpStartPagePrinter )
|
||||
if (hModWinSpoolDrv)
|
||||
{
|
||||
FreeLibrary(hModWinSpoolDrv);
|
||||
hModWinSpoolDrv = NULL;
|
||||
fpAbortPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "AbortPrinter");
|
||||
fpClosePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ClosePrinter");
|
||||
fpCloseSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "CloseSpoolFileHandle");
|
||||
fpCommitSpoolData = (PVOID)GetProcAddress(hModWinSpoolDrv, "CommitSpoolData");
|
||||
// fpConnectToLd64In32Server = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)224);
|
||||
fpDocumentEvent = (PVOID)GetProcAddress(hModWinSpoolDrv,"DocumentEvent");
|
||||
fpDocumentPropertiesW = (PVOID)GetProcAddress(hModWinSpoolDrv, "DocumentPropertiesW");
|
||||
fpEndDocPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndDocPrinter");
|
||||
fpEndPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndPagePrinter");
|
||||
fpGetPrinterW = (PVOID)GetProcAddress( hModWinSpoolDrv,"GetPrinterW");
|
||||
fpGetPrinterDriverW = (PVOID)GetProcAddress(hModWinSpoolDrv,"GetPrinterDriverW");
|
||||
fpGetSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "GetSpoolFileHandle");
|
||||
fpIsValidDevmodeW = (PVOID)GetProcAddress(hModWinSpoolDrv, "IsValidDevmodeW");
|
||||
fpOpenPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "OpenPrinterW");
|
||||
fpQueryColorProfile = (PVOID)GetProcAddress(hModWinSpoolDrv,"QueryColorProfile");
|
||||
fpQueryRemoteFonts = (PVOID)GetProcAddress(hModWinSpoolDrv, "QueryRemoteFonts");
|
||||
fpQuerySpoolMode = (PVOID)GetProcAddress(hModWinSpoolDrv, "QuerySpoolMode");
|
||||
fpReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ReadPrinter");
|
||||
fpResetPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "ResetPrinterW");
|
||||
fpSeekPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "SeekPrinter");
|
||||
fpSplDriverUnloadComplete = (PVOID)GetProcAddress(hModWinSpoolDrv, "SplDriverUnloadComplete");
|
||||
fpSplReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)205);
|
||||
fpStartDocDlgW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocDlgW");
|
||||
fpStartDocPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocPrinterW");
|
||||
fpStartPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartPagePrinter");
|
||||
|
||||
if ( !fpAbortPrinter ||
|
||||
!fpClosePrinter ||
|
||||
!fpCloseSpoolFileHandle ||
|
||||
!fpCommitSpoolData ||
|
||||
!fpDocumentEvent ||
|
||||
!fpDocumentPropertiesW ||
|
||||
!fpEndDocPrinter ||
|
||||
!fpEndPagePrinter ||
|
||||
!fpGetPrinterW ||
|
||||
!fpGetPrinterDriverW ||
|
||||
!fpGetSpoolFileHandle ||
|
||||
!fpIsValidDevmodeW ||
|
||||
!fpOpenPrinterW ||
|
||||
!fpQueryColorProfile ||
|
||||
!fpQueryRemoteFonts ||
|
||||
!fpQuerySpoolMode ||
|
||||
!fpReadPrinter ||
|
||||
!fpResetPrinterW ||
|
||||
!fpSeekPrinter ||
|
||||
!fpSplDriverUnloadComplete ||
|
||||
!fpSplReadPrinter ||
|
||||
!fpStartDocDlgW ||
|
||||
!fpStartDocPrinterW ||
|
||||
!fpStartPagePrinter )
|
||||
{
|
||||
FreeLibrary(hModWinSpoolDrv);
|
||||
hModWinSpoolDrv = NULL;
|
||||
}
|
||||
ghSpooler = hModWinSpoolDrv;
|
||||
}
|
||||
ghSpooler = hModWinSpoolDrv;
|
||||
}
|
||||
RtlLeaveCriticalSection(&semLocal);
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
RtlLeaveCriticalSection(&semLocal);
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
if ( !ghSpooler ) SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
if ( !ghSpooler ) SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
|
||||
return (ghSpooler != NULL);
|
||||
return (ghSpooler != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -274,16 +274,16 @@ LoadTheSpoolerDrv(VOID)
|
|||
4. To end each page, call EndPagePrinter.
|
||||
5. Repeat 2, 3, and 4 for as many pages as necessary.
|
||||
6. To end the print job, call EndDocPrinter.
|
||||
|
||||
|
||||
*/
|
||||
DWORD
|
||||
FASTCALL
|
||||
StartDocPrinterWEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter,
|
||||
DWORD Level,
|
||||
LPBYTE pDocInfo
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter,
|
||||
DWORD Level,
|
||||
LPBYTE pDocInfo
|
||||
)
|
||||
{
|
||||
return fpStartDocPrinterW(hPrinter,Level,pDocInfo);
|
||||
}
|
||||
|
@ -291,9 +291,9 @@ StartDocPrinterWEx(
|
|||
BOOL
|
||||
FASTCALL
|
||||
StartPagePrinterEx(
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
PVOID pvUMPDev,
|
||||
HANDLE hPrinter
|
||||
)
|
||||
{
|
||||
return fpStartPagePrinter(hPrinter);
|
||||
}
|
||||
|
@ -306,49 +306,49 @@ StartPagePrinterEx(
|
|||
int
|
||||
WINAPI
|
||||
AbortDoc(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if ( !(pldc->Flags & LDC_INIT_DOCUMENT) ) return 1;
|
||||
if ( !(pldc->Flags & LDC_INIT_DOCUMENT) ) return 1;
|
||||
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ABORTDOC, 0, NULL, 0, NULL);
|
||||
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ABORTDOC, 0, NULL, 0, NULL);
|
||||
|
||||
if ( pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return Ret;
|
||||
}
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
|
||||
if (NtGdiAbortDoc(hdc))
|
||||
{
|
||||
if (fpAbortPrinter(pldc->hPrinter)) Ret = 1;
|
||||
}
|
||||
else
|
||||
Ret = SP_ERROR;
|
||||
if ( pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_META_PRINT|LDC_STARTPAGE|LDC_INIT_PAGE|LDC_INIT_DOCUMENT|LDC_SAPCALLBACK);
|
||||
if (NtGdiAbortDoc(hdc))
|
||||
{
|
||||
if (fpAbortPrinter(pldc->hPrinter)) Ret = 1;
|
||||
}
|
||||
else
|
||||
Ret = SP_ERROR;
|
||||
|
||||
return Ret;
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_META_PRINT|LDC_STARTPAGE|LDC_INIT_PAGE|LDC_INIT_DOCUMENT|LDC_SAPCALLBACK);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -357,55 +357,55 @@ AbortDoc(
|
|||
int
|
||||
WINAPI
|
||||
EndDoc(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
int Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return Ret;
|
||||
}
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_INIT_DOCUMENT)
|
||||
{
|
||||
BOOL Good;
|
||||
if (pldc->Flags & LDC_INIT_PAGE) EndPage(hdc);
|
||||
if (pldc->Flags & LDC_INIT_DOCUMENT)
|
||||
{
|
||||
BOOL Good;
|
||||
if (pldc->Flags & LDC_INIT_PAGE) EndPage(hdc);
|
||||
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDDOC, 0, NULL, 0, NULL);
|
||||
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDDOC, 0, NULL, 0, NULL);
|
||||
|
||||
Good = NtGdiEndDoc(hdc);
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
|
||||
Good = NtGdiEndDoc(hdc);
|
||||
|
||||
// if (pldc->pUMPDev)
|
||||
Good = EndDocPrinterEx(NULL,pldc->hPrinter);
|
||||
Good = EndDocPrinterEx(NULL,pldc->hPrinter);
|
||||
|
||||
if (Good)
|
||||
{
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDDOCPOST, 0, NULL, 0, NULL);
|
||||
Ret = 1;
|
||||
}
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_STARTPAGE|LDC_INIT_DOCUMENT|LDC_SAPCALLBACK);
|
||||
}
|
||||
return Ret;
|
||||
if (Good)
|
||||
{
|
||||
DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_ENDDOCPOST, 0, NULL, 0, NULL);
|
||||
Ret = 1;
|
||||
}
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_STARTPAGE|LDC_INIT_DOCUMENT|LDC_SAPCALLBACK);
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -415,7 +415,7 @@ int
|
|||
WINAPI
|
||||
EndFormPage(HDC hdc)
|
||||
{
|
||||
return IntEndPage(hdc,TRUE);
|
||||
return IntEndPage(hdc,TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -425,7 +425,7 @@ int
|
|||
WINAPI
|
||||
EndPage(HDC hdc )
|
||||
{
|
||||
return IntEndPage(hdc,FALSE);
|
||||
return IntEndPage(hdc,FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -472,121 +472,121 @@ GdiGetPageCount(HANDLE SpoolFileHandle)
|
|||
int
|
||||
WINAPI
|
||||
StartDocW(
|
||||
HDC hdc,
|
||||
CONST DOCINFOW *lpdi
|
||||
)
|
||||
HDC hdc,
|
||||
CONST DOCINFOW *lpdi
|
||||
)
|
||||
{
|
||||
PLDC pldc;
|
||||
DOCINFOW diW;
|
||||
DOC_INFO_1W di1W;
|
||||
LPWSTR lpwstrRet = NULL;
|
||||
BOOL Banding;
|
||||
int PrnJobNo, Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
DOCINFOW diW;
|
||||
DOC_INFO_1W di1W;
|
||||
LPWSTR lpwstrRet = NULL;
|
||||
BOOL Banding;
|
||||
int PrnJobNo, Ret = SP_ERROR;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
return SP_ERROR;
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
return SP_ERROR;
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc || pldc->Flags & LDC_ATENDPAGE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc || pldc->Flags & LDC_ATENDPAGE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if (!pldc->hPrinter) return SP_ERROR;
|
||||
if (!pldc->hPrinter) return SP_ERROR;
|
||||
|
||||
pldc->Flags &= ~LDC_KILL_DOCUMENT;
|
||||
pldc->Flags &= ~LDC_KILL_DOCUMENT;
|
||||
|
||||
if (lpdi)
|
||||
RtlCopyMemory(&diW, lpdi, sizeof(DOCINFOW));
|
||||
else
|
||||
{
|
||||
diW.cbSize = sizeof(DOCINFOW);
|
||||
diW.lpszDocName = NULL;
|
||||
diW.lpszOutput = NULL;
|
||||
diW.lpszDatatype = NULL;
|
||||
diW.fwType = 0;
|
||||
}
|
||||
if (lpdi)
|
||||
RtlCopyMemory(&diW, lpdi, sizeof(DOCINFOW));
|
||||
else
|
||||
{
|
||||
diW.cbSize = sizeof(DOCINFOW);
|
||||
diW.lpszDocName = NULL;
|
||||
diW.lpszOutput = NULL;
|
||||
diW.lpszDatatype = NULL;
|
||||
diW.fwType = 0;
|
||||
}
|
||||
|
||||
if (!diW.lpszOutput)
|
||||
if (pldc->pwszPort) diW.lpszOutput = pldc->pwszPort;
|
||||
if (!diW.lpszOutput)
|
||||
if (pldc->pwszPort) diW.lpszOutput = pldc->pwszPort;
|
||||
|
||||
lpwstrRet = fpStartDocDlgW(pldc->hPrinter, &diW);
|
||||
if (lpwstrRet == (LPWSTR)SP_APPABORT)
|
||||
{
|
||||
pldc->Flags |= LDC_KILL_DOCUMENT;
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (lpwstrRet == (LPWSTR)SP_ERROR) return SP_ERROR;
|
||||
lpwstrRet = fpStartDocDlgW(pldc->hPrinter, &diW);
|
||||
if (lpwstrRet == (LPWSTR)SP_APPABORT)
|
||||
{
|
||||
pldc->Flags |= LDC_KILL_DOCUMENT;
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (lpwstrRet == (LPWSTR)SP_ERROR) return SP_ERROR;
|
||||
|
||||
if (lpwstrRet != 0) diW.lpszOutput = lpwstrRet;
|
||||
if (lpwstrRet != 0) diW.lpszOutput = lpwstrRet;
|
||||
|
||||
Ret = DocumentEventEx( NULL,
|
||||
pldc->hPrinter,
|
||||
hdc,
|
||||
DOCUMENTEVENT_STARTDOC,
|
||||
sizeof(ULONG),
|
||||
&diW,
|
||||
0,
|
||||
NULL);
|
||||
Ret = DocumentEventEx( NULL,
|
||||
pldc->hPrinter,
|
||||
hdc,
|
||||
DOCUMENTEVENT_STARTDOC,
|
||||
sizeof(ULONG),
|
||||
&diW,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
if (Ret == SP_APPABORT)
|
||||
{
|
||||
pldc->Flags |= LDC_KILL_DOCUMENT;
|
||||
Ret = SP_ERROR;
|
||||
}
|
||||
if (Ret == SP_ERROR)
|
||||
{
|
||||
if (lpwstrRet) LocalFree(lpwstrRet);
|
||||
return Ret;
|
||||
}
|
||||
if (Ret == SP_APPABORT)
|
||||
{
|
||||
pldc->Flags |= LDC_KILL_DOCUMENT;
|
||||
Ret = SP_ERROR;
|
||||
}
|
||||
if (Ret == SP_ERROR)
|
||||
{
|
||||
if (lpwstrRet) LocalFree(lpwstrRet);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
di1W.pDocName = (LPWSTR)diW.lpszDocName;
|
||||
di1W.pOutputFile = (LPWSTR)diW.lpszOutput;
|
||||
di1W.pDatatype = (LPWSTR)diW.lpszDatatype;
|
||||
di1W.pDocName = (LPWSTR)diW.lpszDocName;
|
||||
di1W.pOutputFile = (LPWSTR)diW.lpszOutput;
|
||||
di1W.pDatatype = (LPWSTR)diW.lpszDatatype;
|
||||
|
||||
Ret = SP_ERROR;
|
||||
Ret = SP_ERROR;
|
||||
|
||||
PrnJobNo = StartDocPrinterWEx(NULL, pldc->hPrinter, 1, (LPBYTE)&di1W);
|
||||
if (PrnJobNo <= 0)
|
||||
{
|
||||
Ret = NtGdiStartDoc( hdc, &diW, &Banding, PrnJobNo);
|
||||
if (Ret)
|
||||
{
|
||||
if (pldc->pAbortProc)
|
||||
{
|
||||
GdiSAPCallback(pldc);
|
||||
pldc->Flags |= LDC_SAPCALLBACK;
|
||||
pldc->CallBackTick = GetTickCount();
|
||||
}
|
||||
pldc->Flags |= LDC_INIT_DOCUMENT;
|
||||
if (!Banding) pldc->Flags |= LDC_STARTPAGE;
|
||||
}
|
||||
}
|
||||
if (Ret == SP_ERROR)
|
||||
{
|
||||
//if ( pldc->pUMPDev )
|
||||
AbortPrinterEx(NULL, pldc->hPrinter);
|
||||
DPRINT1("StartDoc Died!!!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( DocumentEventEx( NULL,
|
||||
pldc->hPrinter,
|
||||
hdc,
|
||||
DOCUMENTEVENT_STARTDOCPOST,
|
||||
sizeof(ULONG),
|
||||
&Ret,
|
||||
0,
|
||||
NULL) == SP_ERROR)
|
||||
{
|
||||
AbortDoc(hdc);
|
||||
Ret = SP_ERROR;
|
||||
}
|
||||
}
|
||||
if (lpwstrRet) LocalFree(lpwstrRet);
|
||||
return Ret;
|
||||
PrnJobNo = StartDocPrinterWEx(NULL, pldc->hPrinter, 1, (LPBYTE)&di1W);
|
||||
if (PrnJobNo <= 0)
|
||||
{
|
||||
Ret = NtGdiStartDoc( hdc, &diW, &Banding, PrnJobNo);
|
||||
if (Ret)
|
||||
{
|
||||
if (pldc->pAbortProc)
|
||||
{
|
||||
GdiSAPCallback(pldc);
|
||||
pldc->Flags |= LDC_SAPCALLBACK;
|
||||
pldc->CallBackTick = GetTickCount();
|
||||
}
|
||||
pldc->Flags |= LDC_INIT_DOCUMENT;
|
||||
if (!Banding) pldc->Flags |= LDC_STARTPAGE;
|
||||
}
|
||||
}
|
||||
if (Ret == SP_ERROR)
|
||||
{
|
||||
//if ( pldc->pUMPDev )
|
||||
AbortPrinterEx(NULL, pldc->hPrinter);
|
||||
DPRINT1("StartDoc Died!!!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( DocumentEventEx( NULL,
|
||||
pldc->hPrinter,
|
||||
hdc,
|
||||
DOCUMENTEVENT_STARTDOCPOST,
|
||||
sizeof(ULONG),
|
||||
&Ret,
|
||||
0,
|
||||
NULL) == SP_ERROR)
|
||||
{
|
||||
AbortDoc(hdc);
|
||||
Ret = SP_ERROR;
|
||||
}
|
||||
}
|
||||
if (lpwstrRet) LocalFree(lpwstrRet);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -595,9 +595,9 @@ StartDocW(
|
|||
int
|
||||
WINAPI
|
||||
StartDocA(
|
||||
HDC hdc,
|
||||
CONST DOCINFOA *lpdi
|
||||
)
|
||||
HDC hdc,
|
||||
CONST DOCINFOA *lpdi
|
||||
)
|
||||
{
|
||||
LPWSTR szDocName = NULL, szOutput = NULL, szDatatype = NULL;
|
||||
DOCINFOW docW;
|
||||
|
@ -643,52 +643,52 @@ StartDocA(
|
|||
int
|
||||
WINAPI
|
||||
StartPage(
|
||||
HDC hdc
|
||||
)
|
||||
HDC hdc
|
||||
)
|
||||
{
|
||||
PLDC pldc;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( !pldc )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (pldc->Flags & LDC_META_PRINT)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_STARTPAGE);
|
||||
pldc->Flags &= ~(LDC_ATENDPAGE|LDC_STARTPAGE);
|
||||
|
||||
if (pldc->Flags & LDC_INIT_PAGE) return 1;
|
||||
if (pldc->Flags & LDC_INIT_PAGE) return 1;
|
||||
|
||||
if (DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_STARTPAGE, 0, NULL, 0, NULL) != SP_ERROR)
|
||||
{
|
||||
pldc->Flags |= LDC_INIT_PAGE;
|
||||
if (DocumentEventEx(NULL, pldc->hPrinter, hdc, DOCUMENTEVENT_STARTPAGE, 0, NULL, 0, NULL) != SP_ERROR)
|
||||
{
|
||||
pldc->Flags |= LDC_INIT_PAGE;
|
||||
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
|
||||
|
||||
if (StartPagePrinterEx(NULL, pldc->hPrinter))
|
||||
{
|
||||
if (NtGdiStartPage(hdc)) return 1;
|
||||
}
|
||||
if (StartPagePrinterEx(NULL, pldc->hPrinter))
|
||||
{
|
||||
if (NtGdiStartPage(hdc)) return 1;
|
||||
}
|
||||
|
||||
pldc->Flags &= ~(LDC_INIT_PAGE);
|
||||
EndDoc(hdc);
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
return SP_ERROR;
|
||||
pldc->Flags &= ~(LDC_INIT_PAGE);
|
||||
EndDoc(hdc);
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -697,37 +697,37 @@ StartPage(
|
|||
int
|
||||
WINAPI
|
||||
SetAbortProc(
|
||||
HDC hdc,
|
||||
ABORTPROC lpAbortProc)
|
||||
HDC hdc,
|
||||
ABORTPROC lpAbortProc)
|
||||
{
|
||||
PLDC pldc;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
PLDC pldc;
|
||||
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
|
||||
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
return SP_ERROR;
|
||||
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
|
||||
return SP_ERROR;
|
||||
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( pldc )
|
||||
{
|
||||
if ( lpAbortProc )
|
||||
{
|
||||
if ( pldc->Flags & LDC_INIT_DOCUMENT )
|
||||
{
|
||||
pldc->Flags |= LDC_SAPCALLBACK;
|
||||
pldc->CallBackTick = GetTickCount();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pldc->Flags &= ~LDC_SAPCALLBACK;
|
||||
}
|
||||
pldc->pAbortProc = lpAbortProc;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
return SP_ERROR;
|
||||
pldc = GdiGetLDC(hdc);
|
||||
if ( pldc )
|
||||
{
|
||||
if ( lpAbortProc )
|
||||
{
|
||||
if ( pldc->Flags & LDC_INIT_DOCUMENT )
|
||||
{
|
||||
pldc->Flags |= LDC_SAPCALLBACK;
|
||||
pldc->CallBackTick = GetTickCount();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pldc->Flags &= ~LDC_SAPCALLBACK;
|
||||
}
|
||||
pldc->pAbortProc = lpAbortProc;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
return SP_ERROR;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,26 +7,27 @@
|
|||
BOOL
|
||||
WINAPI
|
||||
TextOutA(
|
||||
HDC hdc,
|
||||
int nXStart,
|
||||
int nYStart,
|
||||
LPCSTR lpString,
|
||||
int cchString)
|
||||
HDC hdc,
|
||||
int nXStart,
|
||||
int nYStart,
|
||||
LPCSTR lpString,
|
||||
int cchString)
|
||||
{
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
|
||||
if (NULL != lpString)
|
||||
{
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
} else
|
||||
StringU.Buffer = NULL;
|
||||
if (NULL != lpString)
|
||||
{
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
}
|
||||
else
|
||||
StringU.Buffer = NULL;
|
||||
|
||||
ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cchString);
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
return ret;
|
||||
ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cchString);
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,13 +37,13 @@ TextOutA(
|
|||
BOOL
|
||||
WINAPI
|
||||
TextOutW(
|
||||
HDC hdc,
|
||||
int nXStart,
|
||||
int nYStart,
|
||||
LPCWSTR lpString,
|
||||
int cchString)
|
||||
HDC hdc,
|
||||
int nXStart,
|
||||
int nYStart,
|
||||
LPCWSTR lpString,
|
||||
int cchString)
|
||||
{
|
||||
return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0);
|
||||
return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,10 +54,10 @@ DWORD
|
|||
WINAPI
|
||||
GdiGetCodePage(HDC hdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc));
|
||||
return LOWORD(Dc_Attr->iCS_CP);
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc));
|
||||
return LOWORD(Dc_Attr->iCS_CP);
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,13 +67,13 @@ GdiGetCodePage(HDC hdc)
|
|||
int
|
||||
WINAPI
|
||||
GetTextCharacterExtra(
|
||||
HDC hDc
|
||||
)
|
||||
HDC hDc
|
||||
)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->lTextExtra;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->lTextExtra;
|
||||
// return GetDCDWord( hDc, GdiGetTextCharExtra, 0);
|
||||
}
|
||||
|
||||
|
@ -96,19 +97,19 @@ GetTextCharset(HDC hdc)
|
|||
BOOL
|
||||
WINAPI
|
||||
GetTextMetricsA(
|
||||
HDC hdc,
|
||||
LPTEXTMETRICA lptm
|
||||
)
|
||||
HDC hdc,
|
||||
LPTEXTMETRICA lptm
|
||||
)
|
||||
{
|
||||
TMW_INTERNAL tmwi;
|
||||
TMW_INTERNAL tmwi;
|
||||
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
FONT_TextMetricWToA(&tmwi.TextMetric, lptm);
|
||||
return TRUE;
|
||||
FONT_TextMetricWToA(&tmwi.TextMetric, lptm);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,19 +119,19 @@ GetTextMetricsA(
|
|||
BOOL
|
||||
WINAPI
|
||||
GetTextMetricsW(
|
||||
HDC hdc,
|
||||
LPTEXTMETRICW lptm
|
||||
)
|
||||
HDC hdc,
|
||||
LPTEXTMETRICW lptm
|
||||
)
|
||||
{
|
||||
TMW_INTERNAL tmwi;
|
||||
TMW_INTERNAL tmwi;
|
||||
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*lptm = tmwi.TextMetric;
|
||||
return TRUE;
|
||||
*lptm = tmwi.TextMetric;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -140,24 +141,24 @@ GetTextMetricsW(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentPointA(
|
||||
HDC hdc,
|
||||
LPCSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
|
||||
ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpSize);
|
||||
ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpSize);
|
||||
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -167,13 +168,13 @@ GetTextExtentPointA(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentPointW(
|
||||
HDC hdc,
|
||||
LPCWSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCWSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -183,24 +184,24 @@ GetTextExtentPointW(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentExPointW(
|
||||
HDC hdc,
|
||||
LPCWSTR lpszStr,
|
||||
int cchString,
|
||||
int nMaxExtent,
|
||||
LPINT lpnFit,
|
||||
LPINT alpDx,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCWSTR lpszStr,
|
||||
int cchString,
|
||||
int nMaxExtent,
|
||||
LPINT lpnFit,
|
||||
LPINT alpDx,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
|
||||
if(nMaxExtent < -1)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if(nMaxExtent < -1)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return NtGdiGetTextExtentExW (
|
||||
hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
|
||||
return NtGdiGetTextExtentExW (
|
||||
hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -210,37 +211,37 @@ GetTextExtentExPointW(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentExPointA(
|
||||
HDC hdc,
|
||||
LPCSTR lpszStr,
|
||||
int cchString,
|
||||
int nMaxExtent,
|
||||
LPINT lpnFit,
|
||||
LPINT alpDx,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCSTR lpszStr,
|
||||
int cchString,
|
||||
int nMaxExtent,
|
||||
LPINT lpnFit,
|
||||
LPINT alpDx,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszStrW;
|
||||
BOOL rc = 0;
|
||||
NTSTATUS Status;
|
||||
LPWSTR lpszStrW;
|
||||
BOOL rc = 0;
|
||||
|
||||
if(nMaxExtent < -1)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if(nMaxExtent < -1)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = NtGdiGetTextExtentExW (
|
||||
hdc, lpszStrW, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
|
||||
Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
|
||||
if (!NT_SUCCESS (Status))
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
else
|
||||
{
|
||||
rc = NtGdiGetTextExtentExW (
|
||||
hdc, lpszStrW, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
|
||||
|
||||
HEAP_free ( lpszStrW );
|
||||
}
|
||||
HEAP_free ( lpszStrW );
|
||||
}
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -250,24 +251,24 @@ GetTextExtentExPointA(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentPoint32A(
|
||||
HDC hdc,
|
||||
LPCSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
|
||||
ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cchString, lpSize);
|
||||
ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cchString, lpSize);
|
||||
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,13 +278,13 @@ GetTextExtentPoint32A(
|
|||
BOOL
|
||||
APIENTRY
|
||||
GetTextExtentPoint32W(
|
||||
HDC hdc,
|
||||
LPCWSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
HDC hdc,
|
||||
LPCWSTR lpString,
|
||||
int cchString,
|
||||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -321,28 +322,28 @@ GetTextExtentPointI(HDC hdc,
|
|||
BOOL
|
||||
WINAPI
|
||||
ExtTextOutA(
|
||||
HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCSTR lpString,
|
||||
UINT cchString,
|
||||
CONST INT *lpDx
|
||||
)
|
||||
HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCSTR lpString,
|
||||
UINT cchString,
|
||||
CONST INT *lpDx
|
||||
)
|
||||
{
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
BOOL ret;
|
||||
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
|
||||
ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cchString, lpDx);
|
||||
ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cchString, lpDx);
|
||||
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -352,17 +353,17 @@ ExtTextOutA(
|
|||
BOOL
|
||||
WINAPI
|
||||
ExtTextOutW(
|
||||
HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCWSTR lpString,
|
||||
UINT cchString,
|
||||
CONST INT *lpDx
|
||||
)
|
||||
HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCWSTR lpString,
|
||||
UINT cchString,
|
||||
CONST INT *lpDx
|
||||
)
|
||||
{
|
||||
return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cchString, (LPINT)lpDx, 0);
|
||||
return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cchString, (LPINT)lpDx, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -436,12 +437,12 @@ GetTextFaceAliasW(HDC hdc,
|
|||
int cChar,
|
||||
LPWSTR pszOut)
|
||||
{
|
||||
if ( pszOut && !cChar )
|
||||
{
|
||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
return NtGdiGetTextFaceW(hdc,cChar,pszOut,TRUE);
|
||||
if ( pszOut && !cChar )
|
||||
{
|
||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
return NtGdiGetTextFaceW(hdc,cChar,pszOut,TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -452,7 +453,7 @@ GetFontResourceInfoW(
|
|||
DWORD *pdwBufSize,
|
||||
void* lpBuffer,
|
||||
DWORD dwType
|
||||
)
|
||||
)
|
||||
{
|
||||
BOOL bRet;
|
||||
UNICODE_STRING NtFileName;
|
||||
|
@ -473,13 +474,13 @@ GetFontResourceInfoW(
|
|||
}
|
||||
|
||||
bRet = NtGdiGetFontResourceInfoInternalW(
|
||||
NtFileName.Buffer,
|
||||
(NtFileName.Length / sizeof(WCHAR)) + 1,
|
||||
1,
|
||||
*pdwBufSize,
|
||||
pdwBufSize,
|
||||
lpBuffer,
|
||||
dwType);
|
||||
NtFileName.Buffer,
|
||||
(NtFileName.Length / sizeof(WCHAR)) + 1,
|
||||
1,
|
||||
*pdwBufSize,
|
||||
pdwBufSize,
|
||||
lpBuffer,
|
||||
dwType);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, NtFileName.Buffer);
|
||||
|
||||
|
@ -498,37 +499,37 @@ GetFontResourceInfoW(
|
|||
int
|
||||
WINAPI
|
||||
SetTextCharacterExtra(
|
||||
HDC hDC,
|
||||
int CharExtra
|
||||
)
|
||||
HDC hDC,
|
||||
int CharExtra
|
||||
)
|
||||
{
|
||||
INT cExtra = 0x80000000;
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT cExtra = 0x80000000;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (CharExtra == cExtra)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return cExtra;
|
||||
}
|
||||
if (CharExtra == cExtra)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return cExtra;
|
||||
}
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
{
|
||||
return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port.
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
{
|
||||
return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port.
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return cExtra;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return cExtra;
|
||||
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||
{
|
||||
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||
}
|
||||
}
|
||||
cExtra = Dc_Attr->lTextExtra;
|
||||
Dc_Attr->lTextExtra = CharExtra;
|
||||
return cExtra;
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||
{
|
||||
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||
}
|
||||
}
|
||||
cExtra = Dc_Attr->lTextExtra;
|
||||
Dc_Attr->lTextExtra = CharExtra;
|
||||
return cExtra;
|
||||
// return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 );
|
||||
}
|
||||
|
||||
|
@ -540,9 +541,9 @@ UINT
|
|||
WINAPI
|
||||
GetTextAlign(HDC hdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->lTextAlign;
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->lTextAlign;
|
||||
}
|
||||
|
||||
|
||||
|
@ -554,9 +555,9 @@ COLORREF
|
|||
WINAPI
|
||||
GetTextColor(HDC hdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->ulForegroundClr;
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||
return Dc_Attr->ulForegroundClr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -569,38 +570,38 @@ WINAPI
|
|||
SetTextAlign(HDC hdc,
|
||||
UINT fMode)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT OldMode = 0;
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT OldMode = 0;
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextAlign( hdc, fMode )
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = Dc_Attr->pvLDC;
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
if return EMFDRV_SetTextAlign( hdc, fMode )
|
||||
}
|
||||
}
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextAlign( hdc, fMode )
|
||||
else
|
||||
{
|
||||
PLDC pLDC = Dc_Attr->pvLDC;
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
if return EMFDRV_SetTextAlign( hdc, fMode )
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldMode;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldMode;
|
||||
|
||||
OldMode = Dc_Attr->lTextAlign;
|
||||
Dc_Attr->lTextAlign = fMode; // Raw
|
||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
||||
{
|
||||
if(!(fMode & TA_CENTER)) fMode |= TA_RIGHT;
|
||||
}
|
||||
Dc_Attr->flTextAlign = fMode & (TA_BASELINE|TA_UPDATECP|TA_CENTER);
|
||||
return OldMode;
|
||||
OldMode = Dc_Attr->lTextAlign;
|
||||
Dc_Attr->lTextAlign = fMode; // Raw
|
||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
||||
{
|
||||
if(!(fMode & TA_CENTER)) fMode |= TA_RIGHT;
|
||||
}
|
||||
Dc_Attr->flTextAlign = fMode & (TA_BASELINE|TA_UPDATECP|TA_CENTER);
|
||||
return OldMode;
|
||||
|
||||
}
|
||||
|
||||
|
@ -611,43 +612,43 @@ SetTextAlign(HDC hdc,
|
|||
COLORREF
|
||||
WINAPI
|
||||
SetTextColor(
|
||||
HDC hdc,
|
||||
COLORREF crColor
|
||||
HDC hdc,
|
||||
COLORREF crColor
|
||||
)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
COLORREF OldColor = CLR_INVALID;
|
||||
PDC_ATTR Dc_Attr;
|
||||
COLORREF OldColor = CLR_INVALID;
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextColor( hDC, crColor );
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = Dc_Attr->pvLDC;
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
if return EMFDRV_SetTextColor( hDC, crColor );
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextColor( hDC, crColor );
|
||||
else
|
||||
{
|
||||
PLDC pLDC = Dc_Attr->pvLDC;
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
if return EMFDRV_SetTextColor( hDC, crColor );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor;
|
||||
|
||||
OldColor = (COLORREF) Dc_Attr->ulForegroundClr;
|
||||
Dc_Attr->ulForegroundClr = (ULONG) crColor;
|
||||
OldColor = (COLORREF) Dc_Attr->ulForegroundClr;
|
||||
Dc_Attr->ulForegroundClr = (ULONG) crColor;
|
||||
|
||||
if ( Dc_Attr->crForegroundClr != crColor )
|
||||
{
|
||||
Dc_Attr->ulDirty_ |= (DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);
|
||||
Dc_Attr->crForegroundClr = crColor;
|
||||
}
|
||||
return OldColor;
|
||||
if ( Dc_Attr->crForegroundClr != crColor )
|
||||
{
|
||||
Dc_Attr->ulDirty_ |= (DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);
|
||||
Dc_Attr->crForegroundClr = crColor;
|
||||
}
|
||||
return OldColor;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -656,34 +657,34 @@ SetTextColor(
|
|||
BOOL
|
||||
WINAPI
|
||||
SetTextJustification(
|
||||
HDC hdc,
|
||||
int extra,
|
||||
int breaks
|
||||
)
|
||||
HDC hdc,
|
||||
int extra,
|
||||
int breaks
|
||||
)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR Dc_Attr;
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextJustification( hdc, extra, breaks )
|
||||
else
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetTextJustification( hdc, extra, breaks )
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||
{
|
||||
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||
}
|
||||
}
|
||||
Dc_Attr->cBreak = breaks;
|
||||
Dc_Attr->lBreakExtra = extra;
|
||||
return TRUE;
|
||||
}
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||
{
|
||||
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||
}
|
||||
}
|
||||
Dc_Attr->cBreak = breaks;
|
||||
Dc_Attr->lBreakExtra = extra;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -24,107 +24,107 @@
|
|||
|
||||
BOOL WINAPI
|
||||
CalculateColorTableSize(
|
||||
CONST BITMAPINFOHEADER *BitmapInfoHeader,
|
||||
UINT *ColorSpec,
|
||||
UINT *ColorTableSize)
|
||||
CONST BITMAPINFOHEADER *BitmapInfoHeader,
|
||||
UINT *ColorSpec,
|
||||
UINT *ColorTableSize)
|
||||
{
|
||||
WORD BitCount;
|
||||
DWORD ClrUsed;
|
||||
DWORD Compression;
|
||||
WORD BitCount;
|
||||
DWORD ClrUsed;
|
||||
DWORD Compression;
|
||||
|
||||
/*
|
||||
* At first get some basic parameters from the passed BitmapInfoHeader
|
||||
* structure. It can have one of the following formats:
|
||||
* - BITMAPCOREHEADER (the oldest one with totally different layout
|
||||
* from the others)
|
||||
* - BITMAPINFOHEADER (the standard and most common header)
|
||||
* - BITMAPV4HEADER (extension of BITMAPINFOHEADER)
|
||||
* - BITMAPV5HEADER (extension of BITMAPV4HEADER)
|
||||
*/
|
||||
/*
|
||||
* At first get some basic parameters from the passed BitmapInfoHeader
|
||||
* structure. It can have one of the following formats:
|
||||
* - BITMAPCOREHEADER (the oldest one with totally different layout
|
||||
* from the others)
|
||||
* - BITMAPINFOHEADER (the standard and most common header)
|
||||
* - BITMAPV4HEADER (extension of BITMAPINFOHEADER)
|
||||
* - BITMAPV5HEADER (extension of BITMAPV4HEADER)
|
||||
*/
|
||||
|
||||
if (BitmapInfoHeader->biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
BitCount = ((LPBITMAPCOREHEADER)BitmapInfoHeader)->bcBitCount;
|
||||
ClrUsed = 0;
|
||||
Compression = BI_RGB;
|
||||
}
|
||||
else
|
||||
{
|
||||
BitCount = BitmapInfoHeader->biBitCount;
|
||||
ClrUsed = BitmapInfoHeader->biClrUsed;
|
||||
Compression = BitmapInfoHeader->biCompression;
|
||||
}
|
||||
if (BitmapInfoHeader->biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
BitCount = ((LPBITMAPCOREHEADER)BitmapInfoHeader)->bcBitCount;
|
||||
ClrUsed = 0;
|
||||
Compression = BI_RGB;
|
||||
}
|
||||
else
|
||||
{
|
||||
BitCount = BitmapInfoHeader->biBitCount;
|
||||
ClrUsed = BitmapInfoHeader->biClrUsed;
|
||||
Compression = BitmapInfoHeader->biCompression;
|
||||
}
|
||||
|
||||
switch (Compression)
|
||||
{
|
||||
case BI_BITFIELDS:
|
||||
if (*ColorSpec == DIB_PAL_COLORS)
|
||||
switch (Compression)
|
||||
{
|
||||
case BI_BITFIELDS:
|
||||
if (*ColorSpec == DIB_PAL_COLORS)
|
||||
*ColorSpec = DIB_RGB_COLORS;
|
||||
|
||||
if (BitCount != 16 && BitCount != 32)
|
||||
if (BitCount != 16 && BitCount != 32)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
* For BITMAPV4HEADER/BITMAPV5HEADER the masks are included in
|
||||
* the structure itself (bV4RedMask, bV4GreenMask, and bV4BlueMask).
|
||||
* For BITMAPINFOHEADER the color masks are stored in the palette.
|
||||
*/
|
||||
/*
|
||||
* For BITMAPV4HEADER/BITMAPV5HEADER the masks are included in
|
||||
* the structure itself (bV4RedMask, bV4GreenMask, and bV4BlueMask).
|
||||
* For BITMAPINFOHEADER the color masks are stored in the palette.
|
||||
*/
|
||||
|
||||
if (BitmapInfoHeader->biSize > sizeof(BITMAPINFOHEADER))
|
||||
if (BitmapInfoHeader->biSize > sizeof(BITMAPINFOHEADER))
|
||||
*ColorTableSize = 0;
|
||||
else
|
||||
else
|
||||
*ColorTableSize = 3;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case BI_RGB:
|
||||
switch (BitCount)
|
||||
{
|
||||
case 1:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 2) : 2;
|
||||
return TRUE;
|
||||
case BI_RGB:
|
||||
switch (BitCount)
|
||||
{
|
||||
case 1:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 2) : 2;
|
||||
return TRUE;
|
||||
|
||||
case 4:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
|
||||
return TRUE;
|
||||
|
||||
case 8:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
if (*ColorSpec == DIB_PAL_COLORS)
|
||||
*ColorSpec = DIB_RGB_COLORS;
|
||||
if (BitCount != 16 && BitCount != 24 && BitCount != 32)
|
||||
return FALSE;
|
||||
*ColorTableSize = ClrUsed;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case BI_RLE4:
|
||||
if (BitCount == 4)
|
||||
{
|
||||
case 4:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case BI_RLE8:
|
||||
if (BitCount == 8)
|
||||
{
|
||||
case 8:
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case BI_JPEG:
|
||||
case BI_PNG:
|
||||
*ColorTableSize = ClrUsed;
|
||||
return TRUE;
|
||||
default:
|
||||
if (*ColorSpec == DIB_PAL_COLORS)
|
||||
*ColorSpec = DIB_RGB_COLORS;
|
||||
if (BitCount != 16 && BitCount != 24 && BitCount != 32)
|
||||
return FALSE;
|
||||
*ColorTableSize = ClrUsed;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
case BI_RLE4:
|
||||
if (BitCount == 4)
|
||||
{
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case BI_RLE8:
|
||||
if (BitCount == 8)
|
||||
{
|
||||
*ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case BI_JPEG:
|
||||
case BI_PNG:
|
||||
*ColorTableSize = ClrUsed;
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,142 +170,142 @@ CalculateColorTableSize(
|
|||
|
||||
LPBITMAPINFO WINAPI
|
||||
ConvertBitmapInfo(
|
||||
CONST BITMAPINFO *BitmapInfo,
|
||||
UINT ColorSpec,
|
||||
UINT *BitmapInfoSize,
|
||||
BOOL FollowedByData)
|
||||
CONST BITMAPINFO *BitmapInfo,
|
||||
UINT ColorSpec,
|
||||
UINT *BitmapInfoSize,
|
||||
BOOL FollowedByData)
|
||||
{
|
||||
LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
|
||||
LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
|
||||
DWORD Size = 0;
|
||||
ULONG DataSize = 0;
|
||||
UINT PaletteEntryCount = 0;
|
||||
LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
|
||||
LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
|
||||
DWORD Size = 0;
|
||||
ULONG DataSize = 0;
|
||||
UINT PaletteEntryCount = 0;
|
||||
|
||||
/*
|
||||
* At first check if the passed BitmapInfo structure has valid size. It
|
||||
* can have one of these headers: BITMAPCOREHEADER, BITMAPINFOHEADER,
|
||||
* BITMAPV4HEADER or BITMAPV5HEADER (see CalculateColorTableSize for
|
||||
* description).
|
||||
*/
|
||||
/*
|
||||
* At first check if the passed BitmapInfo structure has valid size. It
|
||||
* can have one of these headers: BITMAPCOREHEADER, BITMAPINFOHEADER,
|
||||
* BITMAPV4HEADER or BITMAPV5HEADER (see CalculateColorTableSize for
|
||||
* description).
|
||||
*/
|
||||
|
||||
if ( !BitmapInfo ||
|
||||
(BitmapInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER) &&
|
||||
(BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER) ||
|
||||
BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if ( !BitmapInfo ||
|
||||
(BitmapInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER) &&
|
||||
(BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER) ||
|
||||
BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now calculate the color table size. Also if the bitmap info contains
|
||||
* invalid color information it's rejected here.
|
||||
*/
|
||||
/*
|
||||
* Now calculate the color table size. Also if the bitmap info contains
|
||||
* invalid color information it's rejected here.
|
||||
*/
|
||||
|
||||
if (!CalculateColorTableSize(&BitmapInfo->bmiHeader, &ColorSpec,
|
||||
&PaletteEntryCount))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!CalculateColorTableSize(&BitmapInfo->bmiHeader, &ColorSpec,
|
||||
&PaletteEntryCount))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the size of image data if applicable. We must be careful
|
||||
* to do proper aligning on line ends.
|
||||
*/
|
||||
/*
|
||||
* Calculate the size of image data if applicable. We must be careful
|
||||
* to do proper aligning on line ends.
|
||||
*/
|
||||
|
||||
if (FollowedByData)
|
||||
{
|
||||
DataSize = DIB_BitmapBitsSize((PBITMAPINFO)BitmapInfo );
|
||||
}
|
||||
if (FollowedByData)
|
||||
{
|
||||
DataSize = DIB_BitmapBitsSize((PBITMAPINFO)BitmapInfo );
|
||||
}
|
||||
|
||||
/*
|
||||
* If BitmapInfo was originally BITMAPCOREINFO then we need to convert
|
||||
* it to the standard BITMAPINFO layout.
|
||||
*/
|
||||
/*
|
||||
* If BitmapInfo was originally BITMAPCOREINFO then we need to convert
|
||||
* it to the standard BITMAPINFO layout.
|
||||
*/
|
||||
|
||||
if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
Size = sizeof(BITMAPINFOHEADER);
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
Size += PaletteEntryCount * sizeof(RGBQUAD);
|
||||
else
|
||||
Size += PaletteEntryCount * sizeof(USHORT);
|
||||
Size += DataSize;
|
||||
if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
Size = sizeof(BITMAPINFOHEADER);
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
Size += PaletteEntryCount * sizeof(RGBQUAD);
|
||||
else
|
||||
Size += PaletteEntryCount * sizeof(USHORT);
|
||||
Size += DataSize;
|
||||
|
||||
NewBitmapInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
|
||||
if (NewBitmapInfo == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
NewBitmapInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
|
||||
if (NewBitmapInfo == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NewBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
NewBitmapInfo->bmiHeader.biWidth = CoreBitmapInfo->bmciHeader.bcWidth;
|
||||
NewBitmapInfo->bmiHeader.biHeight = CoreBitmapInfo->bmciHeader.bcHeight;
|
||||
NewBitmapInfo->bmiHeader.biPlanes = CoreBitmapInfo->bmciHeader.bcPlanes;
|
||||
NewBitmapInfo->bmiHeader.biBitCount = CoreBitmapInfo->bmciHeader.bcBitCount;
|
||||
NewBitmapInfo->bmiHeader.biCompression = BI_RGB;
|
||||
NewBitmapInfo->bmiHeader.biSizeImage = 0;
|
||||
NewBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
|
||||
NewBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
|
||||
NewBitmapInfo->bmiHeader.biClrUsed = 0;
|
||||
NewBitmapInfo->bmiHeader.biClrImportant = 0;
|
||||
NewBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
NewBitmapInfo->bmiHeader.biWidth = CoreBitmapInfo->bmciHeader.bcWidth;
|
||||
NewBitmapInfo->bmiHeader.biHeight = CoreBitmapInfo->bmciHeader.bcHeight;
|
||||
NewBitmapInfo->bmiHeader.biPlanes = CoreBitmapInfo->bmciHeader.bcPlanes;
|
||||
NewBitmapInfo->bmiHeader.biBitCount = CoreBitmapInfo->bmciHeader.bcBitCount;
|
||||
NewBitmapInfo->bmiHeader.biCompression = BI_RGB;
|
||||
NewBitmapInfo->bmiHeader.biSizeImage = 0;
|
||||
NewBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
|
||||
NewBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
|
||||
NewBitmapInfo->bmiHeader.biClrUsed = 0;
|
||||
NewBitmapInfo->bmiHeader.biClrImportant = 0;
|
||||
|
||||
if (PaletteEntryCount != 0)
|
||||
{
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
{
|
||||
ULONG Index;
|
||||
|
||||
for (Index = 0; Index < PaletteEntryCount; Index++)
|
||||
if (PaletteEntryCount != 0)
|
||||
{
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
{
|
||||
NewBitmapInfo->bmiColors[Index].rgbRed =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtRed;
|
||||
NewBitmapInfo->bmiColors[Index].rgbGreen =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtGreen;
|
||||
NewBitmapInfo->bmiColors[Index].rgbBlue =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtBlue;
|
||||
NewBitmapInfo->bmiColors[Index].rgbReserved = 0;
|
||||
ULONG Index;
|
||||
|
||||
for (Index = 0; Index < PaletteEntryCount; Index++)
|
||||
{
|
||||
NewBitmapInfo->bmiColors[Index].rgbRed =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtRed;
|
||||
NewBitmapInfo->bmiColors[Index].rgbGreen =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtGreen;
|
||||
NewBitmapInfo->bmiColors[Index].rgbBlue =
|
||||
CoreBitmapInfo->bmciColors[Index].rgbtBlue;
|
||||
NewBitmapInfo->bmiColors[Index].rgbReserved = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlCopyMemory(NewBitmapInfo->bmiColors,
|
||||
CoreBitmapInfo->bmciColors,
|
||||
PaletteEntryCount * sizeof(USHORT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlCopyMemory(NewBitmapInfo->bmiColors,
|
||||
CoreBitmapInfo->bmciColors,
|
||||
PaletteEntryCount * sizeof(USHORT));
|
||||
}
|
||||
}
|
||||
|
||||
if (FollowedByData)
|
||||
{
|
||||
ULONG_PTR NewDataPtr, OldDataPtr;
|
||||
if (FollowedByData)
|
||||
{
|
||||
ULONG_PTR NewDataPtr, OldDataPtr;
|
||||
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
{
|
||||
NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors +
|
||||
PaletteEntryCount);
|
||||
OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors +
|
||||
PaletteEntryCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors) +
|
||||
PaletteEntryCount * sizeof(USHORT);
|
||||
OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors) +
|
||||
PaletteEntryCount * sizeof(USHORT);
|
||||
}
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
{
|
||||
NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors +
|
||||
PaletteEntryCount);
|
||||
OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors +
|
||||
PaletteEntryCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors) +
|
||||
PaletteEntryCount * sizeof(USHORT);
|
||||
OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors) +
|
||||
PaletteEntryCount * sizeof(USHORT);
|
||||
}
|
||||
|
||||
RtlCopyMemory((PVOID)NewDataPtr, (PVOID)OldDataPtr, DataSize);
|
||||
}
|
||||
}
|
||||
RtlCopyMemory((PVOID)NewDataPtr, (PVOID)OldDataPtr, DataSize);
|
||||
}
|
||||
}
|
||||
|
||||
Size = NewBitmapInfo->bmiHeader.biSize;
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
Size += PaletteEntryCount * sizeof(RGBQUAD);
|
||||
else
|
||||
Size += PaletteEntryCount * sizeof(USHORT);
|
||||
Size += DataSize;
|
||||
*BitmapInfoSize = Size;
|
||||
Size = NewBitmapInfo->bmiHeader.biSize;
|
||||
if (ColorSpec == DIB_RGB_COLORS)
|
||||
Size += PaletteEntryCount * sizeof(RGBQUAD);
|
||||
else
|
||||
Size += PaletteEntryCount * sizeof(USHORT);
|
||||
Size += DataSize;
|
||||
*BitmapInfoSize = Size;
|
||||
|
||||
return NewBitmapInfo;
|
||||
return NewBitmapInfo;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -315,21 +315,21 @@ 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);
|
||||
pW->lfFaceName[LF_FACESIZE - 1] = '\0';
|
||||
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);
|
||||
pW->lfFaceName[LF_FACESIZE - 1] = '\0';
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
|
@ -342,21 +342,21 @@ 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);
|
||||
pA->lfFaceName[LF_FACESIZE - 1] = '\0';
|
||||
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);
|
||||
pA->lfFaceName[LF_FACESIZE - 1] = '\0';
|
||||
|
||||
#undef COPYN
|
||||
#undef COPYS
|
||||
|
@ -369,13 +369,13 @@ EnumLogFontExW2A( LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW )
|
|||
LogFontW2A( (LPLOGFONTA)fontA, (CONST LOGFONTW *)fontW );
|
||||
|
||||
WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfFullName, -1,
|
||||
(LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
|
||||
(LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
|
||||
fontA->elfFullName[LF_FULLFACESIZE-1] = '\0';
|
||||
WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfStyle, -1,
|
||||
(LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
|
||||
(LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
|
||||
fontA->elfStyle[LF_FACESIZE-1] = '\0';
|
||||
WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfScript, -1,
|
||||
(LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
|
||||
(LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
|
||||
fontA->elfScript[LF_FACESIZE-1] = '\0';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue