implementation of the Eng*Semaphore suite of functions. Thanks David, Ge, MikeN & vizzini.

svn path=/trunk/; revision=5564
This commit is contained in:
Royce Mitchell III 2003-08-13 22:43:15 +00:00
parent 715a74de6d
commit 238a317934
4 changed files with 116 additions and 77 deletions

View file

@ -1159,10 +1159,6 @@ CLIPOBJ_cEnumStart(IN PCLIPOBJ ClipObj,
PPATHOBJ STDCALL
CLIPOBJ_ppoGetPath(PCLIPOBJ ClipObj);
/*
EngAcquireSemaphore
*/
/* FIXME: find correct defines for following symbols */
#define FL_ZERO_MEMORY 1
@ -1239,6 +1235,30 @@ EngCreatePalette(IN ULONG Mode,
IN ULONG Green,
IN ULONG Blue);
HSEMAPHORE
STDCALL
EngCreateSemaphore ( VOID );
VOID
STDCALL
EngAcquireSemaphore ( IN HSEMAPHORE hsem );
VOID
STDCALL
EngReleaseSemaphore ( IN HSEMAPHORE hsem );
VOID
STDCALL
EngDeleteSemaphore ( IN HSEMAPHORE hsem );
BOOL
STDCALL
EngIsSemaphoreOwned ( IN HSEMAPHORE hsem );
BOOL
STDCALL
EngIsSemaphoreOwnedByCurrentThread ( IN HSEMAPHORE hsem );
/*
EngCreatePath
EngCreateSemaphore
@ -1266,7 +1286,6 @@ EngDeletePalette(IN HPALETTE Palette);
/*
EngDeletePath
EngDeleteSemaphore
*/
BOOL STDCALL
@ -1388,7 +1407,6 @@ EngQueryLocalTime
EngQueryPalette
EngQueryPerformanceCounter
EngQueryPerformanceFrequency
EngReleaseSemaphore
EngRestoreFloatingPointState
EngSaveFloatingPointState
EngSecureMem

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.77 2003/08/13 20:25:41 chorns Exp $
# $Id: makefile,v 1.78 2003/08/13 22:43:15 royce Exp $
PATH_TO_TOP = ../..
@ -65,7 +65,7 @@ OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/region.o objects/text.o objects/wingl.o \
objects/bezier.o objects/objconv.o objects/dib.o \
objects/palette.o objects/rect.o objects/polyfill.o \
objects/cursoricon.o
objects/cursoricon.o objects/semaphor.o
DIB_OBJECTS = dib/dib.o dib/dib1bpp.o dib/dib4bpp.o dib/dib8bpp.o dib/dib16bpp.o \
dib/dib24bpp.o dib/dib32bpp.o

View file

@ -0,0 +1,90 @@
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#include <win32k/bitmaps.h>
#include <win32k/debug.h>
#include <win32k/debug1.h>
#include <debug.h>
#include <ddk/winddi.h>
#include "../eng/objects.h"
#include <include/error.h>
/*
* @implemented
*/
HSEMAPHORE
STDCALL
EngCreateSemaphore ( VOID )
{
// www.osr.com/ddk/graphics/gdifncs_95lz.htm
PERESOURCE psem = ExAllocatePool ( NonPagedPool, sizeof(ERESOURCE) );
if ( !psem )
return NULL;
if ( !NT_SUCCESS(ExInitializeResourceLite ( psem )) )
{
ExFreePool ( psem );
return NULL;
}
return (HSEMAPHORE)psem;
}
/*
* @implemented
*/
VOID
STDCALL
EngAcquireSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_14br.htm
ASSERT(hsem);
ExAcquireResourceExclusiveLite ( (PERESOURCE)hsem, TRUE );
}
/*
* @implemented
*/
VOID
STDCALL
EngReleaseSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_5u3r.htm
ASSERT(hsem);
ExReleaseResourceLite ( (PERESOURCE)hsem );
}
/*
* @implemented
*/
VOID
STDCALL
EngDeleteSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_13c7.htm
ASSERT ( hsem );
ExFreePool ( (PVOID)hsem );
}
/*
* @implemented
*/
BOOL
STDCALL
EngIsSemaphoreOwned ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_6wmf.htm
ASSERT(hsem);
return (((PERESOURCE)hsem)->ActiveCount > 0);
}
/*
* @implemented
*/
BOOL
STDCALL
EngIsSemaphoreOwnedByCurrentThread ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_9yxz.htm
ASSERT(hsem);
return ExIsResourceAcquiredExclusiveLite ( (PERESOURCE)hsem );
}

View file

@ -71,75 +71,6 @@ EngUnmapFontFile ( ULONG_PTR iFile )
return EngUnmapFontFileFD ( iFile );
}
/*
* @unimplemented
*/
HSEMAPHORE
STDCALL
EngCreateSemaphore ( VOID )
{
// www.osr.com/ddk/graphics/gdifncs_95lz.htm
UNIMPLEMENTED;
return NULL;
}
/*
* @unimplemented
*/
VOID
STDCALL
EngAcquireSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_14br.htm
UNIMPLEMENTED;
}
/*
* @unimplemented
*/
VOID
STDCALL
EngReleaseSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_5u3r.htm
UNIMPLEMENTED;
}
/*
* @unimplemented
*/
VOID
STDCALL
EngDeleteSemaphore ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_13c7.htm
UNIMPLEMENTED;
}
/*
* @unimplemented
*/
BOOL
STDCALL
EngIsSemaphoreOwned ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_6wmf.htm
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
*/
BOOL
STDCALL
EngIsSemaphoreOwnedByCurrentThread ( IN HSEMAPHORE hsem )
{
// www.osr.com/ddk/graphics/gdifncs_9yxz.htm
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
*/