add more test for EngCreateSemaphore, it checking some info in the internal HANDLE hsem is same as PRTL_CRITICAL_SECTION struct

svn path=/trunk/; revision=33809
This commit is contained in:
Magnus Olsen 2008-06-01 15:06:40 +00:00
parent 828f4f1216
commit 0b090eef6a
3 changed files with 21 additions and 154 deletions

View file

@ -2,13 +2,6 @@
#define _WIN32_WINNT 0x0501
#endif
typedef struct _GDI_TABLE_ENTRY
{
PVOID KernelData; /* Points to the kernel mode structure */
HANDLE ProcessId; /* process id that created the object, 0 for stock objects */
LONG Type; /* the first 16 bit is the object type including the stock obj flag, the last 16 bits is just the object type */
PVOID UserData; /* Points to the user mode structure, usually NULL though */
} GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY;
typedef PGDI_TABLE_ENTRY (CALLBACK * GDIQUERYPROC) (void);
@ -22,29 +15,7 @@ typedef PGDI_TABLE_ENTRY (CALLBACK * GDIQUERYPROC) (void);
#define GDI_HANDLE_STOCK_MASK 0x00800000
#define GDI_HANDLE_REUSE_MASK 0xff000000
#define GDI_HANDLE_REUSECNT_SHIFT 24
#define GDI_HANDLE_UPPER_MASK 0xffff0000
/* Handle macros */
#define GDI_HANDLE_CREATE(i, t) \
((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
#define GDI_HANDLE_GET_INDEX(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK)
#define GDI_HANDLE_GET_TYPE(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK)
#define GDI_HANDLE_IS_TYPE(h, t) \
((t) == (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK))
#define GDI_HANDLE_IS_STOCKOBJ(h) \
(0 != (((ULONG_PTR)(h)) & GDI_HANDLE_STOCK_MASK))
#define GDI_HANDLE_SET_STOCKOBJ(h) \
((h) = (HANDLE)(((ULONG_PTR)(h)) | GDI_HANDLE_STOCK_MASK))
#define GDI_HANDLE_GET_UPPER(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_UPPER_MASK)
#define GDI_OBJECT_TYPE_DC 0x00010000
#define GDI_OBJECT_TYPE_REGION 0x00040000
@ -73,132 +44,8 @@ typedef PGDI_TABLE_ENTRY (CALLBACK * GDIQUERYPROC) (void);
typedef LONG FIX;
typedef struct _EFLOAT_S
{
LONG lMant;
LONG lExp;
} EFLOAT_S;
/* XFORM Structures */
typedef struct _MATRIX_S
{
EFLOAT_S efM11;
EFLOAT_S efM12;
EFLOAT_S efM21;
EFLOAT_S efM22;
EFLOAT_S efDx;
EFLOAT_S efDy;
FIX fxDx;
FIX fxDy;
FLONG flAccel;
} MATRIX;
/* GDI object structures */
typedef struct _RGNATTR
{
ULONG AttrFlags;
ULONG Flags;
RECTL Rect;
} RGNATTR,*PRGNATTR;
// Local DC structure (_DC_ATTR) PVOID pvLDC;
typedef struct _LDC
{
HDC hDC;
ULONG Flags;
INT iType;
PVOID pvEmfDC; /* Pointer to ENHMETAFILE structure */
ABORTPROC pAbortProc; /* AbortProc for Printing */
HANDLE hPrinter; /* Local or Remote Printer driver */
INT iInitPage; /* Start/Stop */
INT iInitDocument;
} LDC, *PLDC;
typedef struct
{
void * pvLDC; // 000
ULONG ulDirty;
HBRUSH hbrush;
HPEN hpen;
COLORREF crBackgroundClr; // 010
ULONG ulBackgroundClr;
COLORREF crForegroundClr;
ULONG ulForegroundClr;
#if (_WIN32_WINNT >= 0x0500)
COLORREF crBrushClr; // 020
ULONG ulBrushClr;
COLORREF crPenClr;
ULONG ulPenClr;
#endif
int iCS_CP; // 030
int iGraphicsMode;
BYTE jROP2; // 038
BYTE jBkMode;
BYTE jFillMode;
BYTE jStretchBltMode;
POINT ptlCurrent; // 03C
POINTFX ptfxCurrent; // 044
long lBkMode; // 04C
long lFillMode; // 050
long lStretchBltMode;
#if (_WIN32_WINNT >= 0x0500)
long flFontMapper; // 058
long lIcmMode;
unsigned hcmXform; // 060
HCOLORSPACE hColorSpace;
FLONG flIcmFlags;
unsigned IcmBrushColor;
unsigned IcmPenColor; // 070
PVOID pvLIcm;
#endif
long flTextAlign; // 078
long lTextAlign;
long lTextExtra; // 080
long lRelAbs;
long lBreakExtra;
long cBreak;
HFONT hlfntNew; // 090
MATRIX mxWorldToDevice; // 094
MATRIX mxDeviceToWorld; // 0D0
MATRIX mxWorldToPage; // 10C
EFLOAT_S efM11PtoD;
EFLOAT_S efM22PtoD;
EFLOAT_S efDxPtoD;
EFLOAT_S efDyPtoD;
int iMapMode; // 168
#if (_WIN32_WINNT >= 0x0500)
DWORD dwLayout; // 16c
long lWindowOrgx; // 170
#endif
POINT ptlWindowOrg; // 174
SIZE szlWindowExt; // 17c
POINT ptlViewportOrg; // 184
SIZE szlViewportExt; // 18c
long flXform; // 194
SIZE szlVirtualDevicePixel; // 198
SIZE szlVirtualDeviceMm; // 1a0
POINT ptlBrushOrigin; // 1a8
unsigned unk1b0_00000000[2]; // 1b0
RGNATTR VisRectRegion;
// unsigned unk1b0_00000000[2]; // 1b0
// unsigned RectRegionFlag; // 1b4
// RECT VisRectRegion; // 1b8
} DC_ATTR, *PDC_ATTR;
HDC WINAPI GdiConvertBitmap(HDC hdc);
HBRUSH WINAPI GdiConvertBrush(HBRUSH hbr);

View file

@ -3,7 +3,17 @@
#define WIN32_NO_STATUS
#include <windows.h>
#include <windows.h>
#include <ndk/ntndk.h>
#include <wingdi.h>
#include <winddi.h>
#include <d3dnthal.h>
#include <prntfont.h>
/* Public Win32K Headers */
#include <win32k/ntgdityp.h>
#include <ntgdi.h>
#include <win32k/ntgdihdl.h>
#include "../apitest.h"
#include "gdi.h"

View file

@ -4,9 +4,19 @@ Test_EngCreateSemaphore(PTESTINFO pti)
{
HSEMAPHORE hsem;
hsem = EngCreateSemaphore();
PRTL_CRITICAL_SECTION lpcrit;
hsem = EngCreateSemaphore();
RTEST ( hsem != NULL );
ASSERT(hsem != NULL);
lpcrit = (PRTL_CRITICAL_SECTION) hsem;
RTEST ( lpcrit->DebugInfo != NULL);
RTEST (lpcrit->LockCount == -1);
RTEST (lpcrit->RecursionCount == 0);
RTEST (lpcrit->OwningThread == 0);
RTEST (lpcrit->LockSemaphore == 0);
RTEST (lpcrit->SpinCount == 0);
EngDeleteSemaphore(hsem);