mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Implement EngQueryPerformanceFrequency, EngQueryPerformanceCounter and
partly Eng(Un)SecureMem svn path=/trunk/; revision=4928
This commit is contained in:
parent
86d2a51a17
commit
9ad6e7c184
7 changed files with 101 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _INCLUDE_DDK_MMFUNCS_H
|
#ifndef _INCLUDE_DDK_MMFUNCS_H
|
||||||
#define _INCLUDE_DDK_MMFUNCS_H
|
#define _INCLUDE_DDK_MMFUNCS_H
|
||||||
/* $Id: mmfuncs.h,v 1.15 2003/05/14 10:51:26 ekohl Exp $ */
|
/* $Id: mmfuncs.h,v 1.16 2003/06/19 17:13:27 gvg Exp $ */
|
||||||
/* MEMORY MANAGMENT ******************************************************/
|
/* MEMORY MANAGMENT ******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -455,12 +455,12 @@ MmResetDriverPaging (
|
||||||
PVOID AddressWithinSection
|
PVOID AddressWithinSection
|
||||||
);
|
);
|
||||||
|
|
||||||
DWORD
|
PVOID
|
||||||
STDCALL
|
STDCALL
|
||||||
MmSecureVirtualMemory (
|
MmSecureVirtualMemory (
|
||||||
DWORD Unknown0,
|
PVOID Address,
|
||||||
DWORD Unknown1,
|
SIZE_T Length,
|
||||||
DWORD Unknown2
|
ULONG Mode
|
||||||
);
|
);
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -548,6 +548,6 @@ MmUnmapViewOfSection (
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
MmUnsecureVirtualMemory (
|
MmUnsecureVirtualMemory (
|
||||||
DWORD Unknown0
|
PVOID SecureMem
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: virtual.c,v 1.65 2003/04/28 10:37:40 gvg Exp $
|
/* $Id: virtual.c,v 1.66 2003/06/19 17:13:28 gvg Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/virtual.c
|
* FILE: ntoskrnl/mm/virtual.c
|
||||||
|
@ -344,19 +344,31 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD STDCALL
|
PVOID STDCALL
|
||||||
MmSecureVirtualMemory (DWORD Unknown0,
|
MmSecureVirtualMemory (PVOID Address,
|
||||||
DWORD Unknown1,
|
SIZE_T Length,
|
||||||
DWORD Unknown2)
|
ULONG Mode)
|
||||||
{
|
{
|
||||||
|
/* Only works for user space */
|
||||||
|
if (MmHighestUserAddress < Address)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
MmUnsecureVirtualMemory (DWORD Unknown0)
|
MmUnsecureVirtualMemory(PVOID SecureMem)
|
||||||
{
|
{
|
||||||
|
if (NULL == SecureMem)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: mem.c,v 1.9 2003/06/06 10:17:44 gvg Exp $
|
/* $Id: mem.c,v 1.10 2003/06/19 17:13:28 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -30,6 +30,10 @@
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <ddk/winddi.h>
|
#include <ddk/winddi.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <win32k/debug1.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
typedef struct _USERMEMHEADER
|
typedef struct _USERMEMHEADER
|
||||||
{
|
{
|
||||||
ULONG Tag;
|
ULONG Tag;
|
||||||
|
@ -90,4 +94,17 @@ EngFreeUserMem(PVOID pv)
|
||||||
|
|
||||||
ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_DECOMMIT);
|
ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_DECOMMIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HANDLE STDCALL
|
||||||
|
EngSecureMem(PVOID Address, ULONG Length)
|
||||||
|
{
|
||||||
|
return MmSecureVirtualMemory(Address, Length, PAGE_READWRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
EngUnsecureMem(HANDLE Mem)
|
||||||
|
{
|
||||||
|
return MmUnsecureVirtualMemory((PVOID) Mem);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
51
reactos/subsys/win32k/eng/perfcnt.c
Normal file
51
reactos/subsys/win32k/eng/perfcnt.c
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* ReactOS W32 Subsystem
|
||||||
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
/* $Id: perfcnt.c,v 1.1 2003/06/19 17:13:28 gvg Exp $
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS kernel
|
||||||
|
* PURPOSE: GDI Driver Performance Counter Functions
|
||||||
|
* FILE: subsys/win32k/eng/perfcnt.c
|
||||||
|
* PROGRAMER: Ge van Geldorp
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ddk/ntddk.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <win32k/debug1.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
EngQueryPerformanceFrequency(LONGLONG *Frequency)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER Freq;
|
||||||
|
|
||||||
|
__asm__("int $3\n");
|
||||||
|
KeQueryPerformanceCounter(&Freq);
|
||||||
|
*Frequency = Freq.QuadPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
EngQueryPerformanceCounter(LONGLONG *Count)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER PerfCount;
|
||||||
|
|
||||||
|
PerfCount = KeQueryPerformanceCounter(NULL);
|
||||||
|
*Count = PerfCount.QuadPart;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.65 2003/06/05 22:47:47 gdalsnes Exp $
|
# $Id: makefile,v 1.66 2003/06/19 17:13:28 gvg Exp $
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ TARGET_LFLAGS =\
|
||||||
|
|
||||||
ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o \
|
ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o \
|
||||||
eng/copybits.o eng/device.o eng/handle.o eng/lineto.o eng/paint.o \
|
eng/copybits.o eng/device.o eng/handle.o eng/lineto.o eng/paint.o \
|
||||||
eng/palette.o eng/surface.o eng/xlate.o eng/transblt.o eng/mouse.o \
|
eng/palette.o eng/perfcnt.o eng/surface.o eng/xlate.o eng/transblt.o \
|
||||||
eng/misc.o
|
eng/mouse.o eng/misc.o
|
||||||
|
|
||||||
MAIN_OBJECTS = main/dllmain.o main/svctabm.o
|
MAIN_OBJECTS = main/dllmain.o main/svctabm.o
|
||||||
|
|
||||||
|
|
|
@ -52,12 +52,9 @@ STUB(EngProbeForRead)
|
||||||
STUB(EngProbeForReadAndWrite)
|
STUB(EngProbeForReadAndWrite)
|
||||||
STUB(EngQueryLocalTime)
|
STUB(EngQueryLocalTime)
|
||||||
STUB(EngQueryPalette)
|
STUB(EngQueryPalette)
|
||||||
STUB(EngQueryPerformanceCounter)
|
|
||||||
STUB(EngQueryPerformanceFrequency)
|
|
||||||
STUB(EngReleaseSemaphore)
|
STUB(EngReleaseSemaphore)
|
||||||
STUB(EngRestoreFloatingPointState)
|
STUB(EngRestoreFloatingPointState)
|
||||||
STUB(EngSaveFloatingPointState)
|
STUB(EngSaveFloatingPointState)
|
||||||
STUB(EngSecureMem)
|
|
||||||
STUB(EngSetEvent)
|
STUB(EngSetEvent)
|
||||||
STUB(EngSetLastError)
|
STUB(EngSetLastError)
|
||||||
STUB(EngSetPointerShape)
|
STUB(EngSetPointerShape)
|
||||||
|
@ -73,7 +70,6 @@ STUB(EngUnloadImage)
|
||||||
STUB(EngUnlockDriverObj)
|
STUB(EngUnlockDriverObj)
|
||||||
STUB(EngUnmapEvent)
|
STUB(EngUnmapEvent)
|
||||||
STUB(EngUnmapFontFile)
|
STUB(EngUnmapFontFile)
|
||||||
STUB(EngUnsecureMem)
|
|
||||||
STUB(EngWaitForSingleObject)
|
STUB(EngWaitForSingleObject)
|
||||||
STUB(EngWideCharToMultiByte)
|
STUB(EngWideCharToMultiByte)
|
||||||
STUB(EngWritePrinter)
|
STUB(EngWritePrinter)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: win32k.edf,v 1.8 2003/02/15 19:16:33 gvg Exp $
|
; $Id: win32k.edf,v 1.9 2003/06/19 17:13:28 gvg Exp $
|
||||||
;
|
;
|
||||||
; win32k.def
|
; win32k.def
|
||||||
;
|
;
|
||||||
|
@ -81,12 +81,12 @@ EngProbeForRead
|
||||||
EngProbeForReadAndWrite
|
EngProbeForReadAndWrite
|
||||||
EngQueryLocalTime
|
EngQueryLocalTime
|
||||||
EngQueryPalette
|
EngQueryPalette
|
||||||
EngQueryPerformanceCounter
|
EngQueryPerformanceCounter=EngQueryPerformanceCounter@4
|
||||||
EngQueryPerformanceFrequency
|
EngQueryPerformanceFrequency=EngQueryPerformanceFrequency@4
|
||||||
EngReleaseSemaphore
|
EngReleaseSemaphore
|
||||||
EngRestoreFloatingPointState
|
EngRestoreFloatingPointState
|
||||||
EngSaveFloatingPointState
|
EngSaveFloatingPointState
|
||||||
EngSecureMem
|
EngSecureMem=EngSecureMem@8
|
||||||
EngSetEvent
|
EngSetEvent
|
||||||
EngSetLastError
|
EngSetLastError
|
||||||
EngSetPointerShape
|
EngSetPointerShape
|
||||||
|
@ -105,7 +105,7 @@ EngUnlockSurface=EngUnlockSurface@4
|
||||||
EngUnmapEvent
|
EngUnmapEvent
|
||||||
EngUnmapFontFile
|
EngUnmapFontFile
|
||||||
; EngUnsecureMem = NTOSKRNL.MmUnsecureVirtualMemory
|
; EngUnsecureMem = NTOSKRNL.MmUnsecureVirtualMemory
|
||||||
EngUnsecureMem
|
EngUnsecureMem=EngUnsecureMem@4
|
||||||
EngWaitForSingleObject
|
EngWaitForSingleObject
|
||||||
EngWideCharToMultiByte
|
EngWideCharToMultiByte
|
||||||
EngWritePrinter
|
EngWritePrinter
|
||||||
|
|
Loading…
Reference in a new issue