mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
implementation of the Eng*Semaphore suite of functions. Thanks David, Ge, MikeN & vizzini.
svn path=/trunk/; revision=5564
This commit is contained in:
parent
715a74de6d
commit
238a317934
4 changed files with 116 additions and 77 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
90
reactos/subsys/win32k/objects/semaphor.c
Normal file
90
reactos/subsys/win32k/objects/semaphor.c
Normal 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 );
|
||||
}
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue