mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:56:06 +00:00
- Fixed prototypes of NtAddAtom, NtFindAtom, NtProtectVirtualMemory and KeQueryInterruptTime.
svn path=/trunk/; revision=9660
This commit is contained in:
parent
25ae3e20a7
commit
ebb7ad1e4a
13 changed files with 111 additions and 83 deletions
|
@ -1,7 +1,7 @@
|
|||
NtAcceptConnectPort ZwAcceptConnectPort 6
|
||||
NtAccessCheck ZwAccessCheck 8
|
||||
NtAccessCheckAndAuditAlarm ZwAccessCheckAndAuditAlarm 11
|
||||
NtAddAtom ZwAddAtom 2
|
||||
NtAddAtom ZwAddAtom 3
|
||||
NtAdjustGroupsToken ZwAdjustGroupsToken 6
|
||||
NtAdjustPrivilegesToken ZwAdjustPrivilegesToken 6
|
||||
NtAlertResumeThread ZwAlertResumeThread 2
|
||||
|
@ -51,7 +51,7 @@ NtDuplicateToken ZwDuplicateToken 6
|
|||
NtEnumerateKey ZwEnumerateKey 6
|
||||
NtEnumerateValueKey ZwEnumerateValueKey 6
|
||||
NtExtendSection ZwExtendSection 2
|
||||
NtFindAtom ZwFindAtom 2
|
||||
NtFindAtom ZwFindAtom 3
|
||||
NtFlushBuffersFile ZwFlushBuffersFile 2
|
||||
NtFlushInstructionCache ZwFlushInstructionCache 3
|
||||
NtFlushKey ZwFlushKey 1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/* $Id: zw.h,v 1.24 2004/05/01 19:22:49 ekohl Exp $
|
||||
/* $Id: zw.h,v 1.25 2004/06/13 10:35:51 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -4878,8 +4878,8 @@ NTSTATUS
|
|||
STDCALL
|
||||
NtProtectVirtualMemory(
|
||||
IN HANDLE ProcessHandle,
|
||||
IN PVOID BaseAddress,
|
||||
IN ULONG NumberOfBytesToProtect,
|
||||
IN PVOID *BaseAddress,
|
||||
IN ULONG *NumberOfBytesToProtect,
|
||||
IN ULONG NewAccessProtection,
|
||||
OUT PULONG OldAccessProtection
|
||||
);
|
||||
|
@ -5235,8 +5235,9 @@ ZwAccessCheckAndAuditAlarm(
|
|||
/*
|
||||
* FUNCTION: Adds an atom to the global atom table
|
||||
* ARGUMENTS:
|
||||
* AtomString = The string to add to the atom table.
|
||||
* Atom (OUT) = Caller supplies storage for the resulting atom.
|
||||
* AtomName = The string to add to the atom table.
|
||||
* AtomNameLength = Length of the atom name
|
||||
* Atom (OUT) = Caller supplies storage for the resulting atom.
|
||||
* REMARKS: The arguments map to the win32 add GlobalAddAtom.
|
||||
* RETURNS: Status
|
||||
*/
|
||||
|
@ -5244,6 +5245,7 @@ NTSTATUS
|
|||
STDCALL
|
||||
NtAddAtom(
|
||||
IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
IN OUT PRTL_ATOM Atom
|
||||
);
|
||||
|
||||
|
@ -5252,6 +5254,7 @@ NTSTATUS
|
|||
STDCALL
|
||||
ZwAddAtom(
|
||||
IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
IN OUT PRTL_ATOM Atom
|
||||
);
|
||||
|
||||
|
@ -5350,6 +5353,7 @@ ZwDuplicateToken(
|
|||
* FUNCTION: Finds a atom
|
||||
* ARGUMENTS:
|
||||
* AtomName = Name to search for.
|
||||
* AtomNameLength = Length of the atom name
|
||||
* Atom = Caller supplies storage for the resulting atom
|
||||
* RETURNS: Status
|
||||
* REMARKS:
|
||||
|
@ -5359,6 +5363,7 @@ NTSTATUS
|
|||
STDCALL
|
||||
NtFindAtom(
|
||||
IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
OUT PRTL_ATOM Atom OPTIONAL
|
||||
);
|
||||
|
||||
|
@ -5366,6 +5371,7 @@ NTSTATUS
|
|||
STDCALL
|
||||
ZwFindAtom(
|
||||
IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
OUT PRTL_ATOM Atom OPTIONAL
|
||||
);
|
||||
|
||||
|
@ -5491,8 +5497,8 @@ NTSTATUS
|
|||
STDCALL
|
||||
ZwProtectVirtualMemory(
|
||||
IN HANDLE ProcessHandle,
|
||||
IN PVOID BaseAddress,
|
||||
IN ULONG NumberOfBytesToProtect,
|
||||
IN PVOID *BaseAddress,
|
||||
IN ULONG *NumberOfBytesToProtect,
|
||||
IN ULONG NewAccessProtection,
|
||||
OUT PULONG OldAccessProtection
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: virtual.c,v 1.12 2004/01/23 17:13:36 ekohl Exp $
|
||||
/* $Id: virtual.c,v 1.13 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -126,8 +126,8 @@ VirtualProtectEx(HANDLE hProcess,
|
|||
NTSTATUS Status;
|
||||
|
||||
Status = NtProtectVirtualMemory(hProcess,
|
||||
(PVOID)lpAddress,
|
||||
dwSize,
|
||||
&lpAddress,
|
||||
&dwSize,
|
||||
flNewProtect,
|
||||
(PULONG)lpflOldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: atom.c,v 1.19 2004/01/23 21:16:03 ekohl Exp $
|
||||
/* $Id: atom.c,v 1.20 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -49,6 +49,7 @@ GlobalAddAtomA(LPCSTR lpString)
|
|||
(LPSTR)lpString);
|
||||
|
||||
Status = NtAddAtom(AtomName.Buffer,
|
||||
AtomName.Length,
|
||||
&Atom);
|
||||
RtlFreeUnicodeString(&AtomName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -81,6 +82,7 @@ GlobalAddAtomW(LPCWSTR lpString)
|
|||
}
|
||||
|
||||
Status = NtAddAtom((LPWSTR)lpString,
|
||||
wcslen(lpString),
|
||||
&Atom);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -139,6 +141,7 @@ GlobalFindAtomA(LPCSTR lpString)
|
|||
RtlCreateUnicodeStringFromAsciiz(&AtomName,
|
||||
(LPSTR)lpString);
|
||||
Status = NtFindAtom(AtomName.Buffer,
|
||||
AtomName.Length,
|
||||
&Atom);
|
||||
RtlFreeUnicodeString(&AtomName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -171,6 +174,7 @@ GlobalFindAtomW(LPCWSTR lpString)
|
|||
}
|
||||
|
||||
Status = NtFindAtom((LPWSTR)lpString,
|
||||
wcslen(lpString),
|
||||
&Atom);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.def,v 1.120 2004/05/13 21:01:14 navaraf Exp $
|
||||
; $Id: ntdll.def,v 1.121 2004/06/13 10:35:52 navaraf Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -64,7 +64,7 @@ NlsMbOemCodePageTag DATA
|
|||
NtAcceptConnectPort@24
|
||||
NtAccessCheck@32
|
||||
NtAccessCheckAndAuditAlarm@44
|
||||
NtAddAtom@8
|
||||
NtAddAtom@12
|
||||
NtAdjustGroupsToken@24
|
||||
NtAdjustPrivilegesToken@24
|
||||
NtAlertResumeThread@8
|
||||
|
@ -116,7 +116,7 @@ NtDuplicateToken@24
|
|||
NtEnumerateKey@24
|
||||
NtEnumerateValueKey@24
|
||||
NtExtendSection@8
|
||||
NtFindAtom@8
|
||||
NtFindAtom@12
|
||||
NtFlushBuffersFile@8
|
||||
NtFlushInstructionCache@12
|
||||
NtFlushKey@4
|
||||
|
@ -654,7 +654,7 @@ RtlxUnicodeStringToOemSize@4
|
|||
ZwAcceptConnectPort@24
|
||||
ZwAccessCheck@32
|
||||
ZwAccessCheckAndAuditAlarm@44
|
||||
ZwAddAtom@8
|
||||
ZwAddAtom@12
|
||||
ZwAdjustGroupsToken@24
|
||||
ZwAdjustPrivilegesToken@24
|
||||
ZwAlertResumeThread@8
|
||||
|
@ -704,7 +704,7 @@ ZwDuplicateToken@24
|
|||
ZwEnumerateKey@24
|
||||
ZwEnumerateValueKey@24
|
||||
ZwExtendSection@8
|
||||
ZwFindAtom@8
|
||||
ZwFindAtom@12
|
||||
ZwFlushBuffersFile@8
|
||||
ZwFlushInstructionCache@12
|
||||
ZwFlushKey@4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.edf,v 1.110 2004/05/13 21:01:14 navaraf Exp $
|
||||
; $Id: ntdll.edf,v 1.111 2004/06/13 10:35:52 navaraf Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -64,7 +64,7 @@ NlsMbOemCodePageTag DATA
|
|||
NtAcceptConnectPort=NtAcceptConnectPort@24
|
||||
NtAccessCheck=NtAccessCheck@32
|
||||
NtAccessCheckAndAuditAlarm=NtAccessCheckAndAuditAlarm@44
|
||||
NtAddAtom=NtAddAtom@8
|
||||
NtAddAtom=NtAddAtom@12
|
||||
NtAdjustGroupsToken=NtAdjustGroupsToken@24
|
||||
NtAdjustPrivilegesToken=NtAdjustPrivilegesToken@24
|
||||
NtAlertResumeThread=NtAlertResumeThread@8
|
||||
|
@ -116,7 +116,7 @@ NtDuplicateToken=NtDuplicateToken@24
|
|||
NtEnumerateKey=NtEnumerateKey@24
|
||||
NtEnumerateValueKey=NtEnumerateValueKey@24
|
||||
NtExtendSection=NtExtendSection@8
|
||||
NtFindAtom=NtFindAtom@8
|
||||
NtFindAtom=NtFindAtom@12
|
||||
NtFlushBuffersFile=NtFlushBuffersFile@8
|
||||
NtFlushInstructionCache=NtFlushInstructionCache@12
|
||||
NtFlushKey=NtFlushKey@4
|
||||
|
@ -656,7 +656,7 @@ RtlxUnicodeStringToOemSize=RtlxUnicodeStringToOemSize@4
|
|||
ZwAcceptConnectPort=ZwAcceptConnectPort@24
|
||||
ZwAccessCheck=ZwAccessCheck@32
|
||||
ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44
|
||||
ZwAddAtom=ZwAddAtom@8
|
||||
ZwAddAtom=ZwAddAtom@12
|
||||
ZwAdjustGroupsToken=ZwAdjustGroupsToken@24
|
||||
ZwAdjustPrivilegesToken=ZwAdjustPrivilegesToken@24
|
||||
ZwAlertResumeThread=ZwAlertResumeThread@8
|
||||
|
@ -706,7 +706,7 @@ ZwDuplicateToken=ZwDuplicateToken@24
|
|||
ZwEnumerateKey=ZwEnumerateKey@24
|
||||
ZwEnumerateValueKey=ZwEnumerateValueKey@24
|
||||
ZwExtendSection=ZwExtendSection@8
|
||||
ZwFindAtom=ZwFindAtom@8
|
||||
ZwFindAtom=ZwFindAtom@12
|
||||
ZwFlushBuffersFile=ZwFlushBuffersFile@8
|
||||
ZwFlushInstructionCache=ZwFlushInstructionCache@12
|
||||
ZwFlushKey=ZwFlushKey@4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: utils.c,v 1.87 2004/06/02 18:26:58 gvg Exp $
|
||||
/* $Id: utils.c,v 1.88 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1235,7 +1235,11 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
int i;
|
||||
PIMAGE_DATA_DIRECTORY RelocationDDir;
|
||||
ULONG OldProtect;
|
||||
PVOID ProtectBase;
|
||||
ULONG ProtectSize;
|
||||
ULONG OldProtect2;
|
||||
PVOID ProtectBase2;
|
||||
ULONG ProtectSize2;
|
||||
NTSTATUS Status;
|
||||
PIMAGE_SECTION_HEADER Sections;
|
||||
ULONG MaxExtend;
|
||||
|
@ -1286,10 +1290,11 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
RelocationDir->SizeOfBlock - sizeof (RELOCATION_DIRECTORY);
|
||||
NumberOfEntries = NumberOfEntries / sizeof (RELOCATION_ENTRY);
|
||||
|
||||
ProtectBase = ImageBase + RelocationDir->VirtualAddress;
|
||||
ProtectSize = PAGE_SIZE;
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress,
|
||||
PAGE_SIZE,
|
||||
&ProtectBase,
|
||||
&ProtectSize,
|
||||
PAGE_READWRITE,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1300,21 +1305,21 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
|
||||
if (RelocationDir->VirtualAddress + PAGE_SIZE < MaxExtend)
|
||||
{
|
||||
ProtectBase2 = ImageBase + RelocationDir->VirtualAddress + PAGE_SIZE;
|
||||
ProtectSize2 = PAGE_SIZE;
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress + PAGE_SIZE,
|
||||
PAGE_SIZE,
|
||||
&ProtectBase2,
|
||||
&ProtectSize2,
|
||||
PAGE_READWRITE,
|
||||
&OldProtect2);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to unprotect relocation target (2).\n");
|
||||
NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress,
|
||||
PAGE_SIZE,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
&ProtectBase,
|
||||
&ProtectSize,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
return(Status);
|
||||
}
|
||||
}
|
||||
|
@ -1360,9 +1365,8 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
}
|
||||
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress,
|
||||
PAGE_SIZE,
|
||||
&ProtectBase,
|
||||
&ProtectSize,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1374,9 +1378,8 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
if (RelocationDir->VirtualAddress + PAGE_SIZE < MaxExtend)
|
||||
{
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress + PAGE_SIZE,
|
||||
PAGE_SIZE,
|
||||
&ProtectBase2,
|
||||
&ProtectSize2,
|
||||
OldProtect2,
|
||||
&OldProtect2);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1468,11 +1471,12 @@ LdrpProcessImportDirectoryEntry(
|
|||
|
||||
/* Unprotect the region we are about to write into. */
|
||||
IATBase = (PVOID)ImportAddressList;
|
||||
IATSize *= sizeof(PVOID*);
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
IATBase,
|
||||
IATSize * sizeof(PVOID*),
|
||||
PAGE_READWRITE,
|
||||
&OldProtect);
|
||||
&IATBase,
|
||||
&IATSize,
|
||||
PAGE_READWRITE,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to unprotect IAT.\n");
|
||||
|
@ -1509,8 +1513,8 @@ LdrpProcessImportDirectoryEntry(
|
|||
|
||||
/* Protect the region we are about to write into. */
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
IATBase,
|
||||
IATSize * sizeof(PVOID*),
|
||||
&IATBase,
|
||||
&IATSize,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1626,9 +1630,10 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
|
|||
|
||||
/* Unprotect the region we are about to write into. */
|
||||
IATBase = (PVOID)ImportAddressList;
|
||||
IATSize *= sizeof(PVOID*);
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
IATBase,
|
||||
IATSize * sizeof(PVOID*),
|
||||
&IATBase,
|
||||
&IATSize,
|
||||
PAGE_READWRITE,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1655,8 +1660,8 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
|
|||
|
||||
/* Protect the region we are about to write into. */
|
||||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
IATBase,
|
||||
IATSize * sizeof(PVOID*),
|
||||
&IATBase,
|
||||
&IATSize,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: sysinfo.c,v 1.35 2004/05/26 19:56:35 navaraf Exp $
|
||||
/* $Id: sysinfo.c,v 1.36 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -28,7 +28,7 @@
|
|||
#include <internal/debug.h>
|
||||
|
||||
extern ULONG NtGlobalFlag; /* FIXME: it should go in a ddk/?.h */
|
||||
VOID STDCALL KeQueryInterruptTime(PLARGE_INTEGER CurrentTime);
|
||||
ULONGLONG STDCALL KeQueryInterruptTime(VOID);
|
||||
|
||||
VOID MmPrintMemoryStatistic(VOID);
|
||||
|
||||
|
@ -647,7 +647,7 @@ QSI_DEF(SystemProcessorPerformanceInformation)
|
|||
|
||||
PsLookupProcessByProcessId((PVOID) 1, &TheIdleProcess);
|
||||
|
||||
KeQueryInterruptTime((PLARGE_INTEGER) &CurrentTime);
|
||||
CurrentTime.QuadPart = KeQueryInterruptTime();
|
||||
|
||||
Spi->TotalProcessorRunTime.QuadPart =
|
||||
TheIdleProcess->Pcb.KernelTime * 100000; // IdleTime
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: timer.c,v 1.72 2004/04/20 20:38:41 jimtabor Exp $
|
||||
/* $Id: timer.c,v 1.73 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -224,16 +224,19 @@ KeQuerySystemTime(PLARGE_INTEGER CurrentTime)
|
|||
while (CurrentTime->u.HighPart != SharedUserData->SystemTime.High2Part);
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
KeQueryInterruptTime(PLARGE_INTEGER CurrentTime)
|
||||
ULONGLONG STDCALL
|
||||
KeQueryInterruptTime(VOID)
|
||||
{
|
||||
LARGE_INTEGER CurrentTime;
|
||||
|
||||
do
|
||||
{
|
||||
CurrentTime->u.HighPart = SharedUserData->InterruptTime.High1Part;
|
||||
CurrentTime->u.LowPart = SharedUserData->InterruptTime.LowPart;
|
||||
CurrentTime.u.HighPart = SharedUserData->InterruptTime.High1Part;
|
||||
CurrentTime.u.LowPart = SharedUserData->InterruptTime.LowPart;
|
||||
}
|
||||
while (CurrentTime->u.HighPart != SharedUserData->InterruptTime.High2Part);
|
||||
while (CurrentTime.u.HighPart != SharedUserData->InterruptTime.High2Part);
|
||||
|
||||
return CurrentTime.QuadPart;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -305,9 +308,8 @@ KeSetTimerEx (PKTIMER Timer,
|
|||
Timer->Dpc = Dpc;
|
||||
if (DueTime.QuadPart < 0)
|
||||
{
|
||||
KeQueryInterruptTime(&Time);
|
||||
Timer->Header.Absolute = 0;
|
||||
Timer->DueTime.QuadPart = Time.QuadPart - DueTime.QuadPart;
|
||||
Timer->DueTime.QuadPart = KeQueryInterruptTime() - DueTime.QuadPart;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -542,7 +544,7 @@ KeExpireTimers(PKDPC Dpc,
|
|||
|
||||
KeAcquireSpinLockAtDpcLevel(&TimerListLock);
|
||||
|
||||
KeQueryInterruptTime(&InterruptTime);
|
||||
InterruptTime.QuadPart = KeQueryInterruptTime();
|
||||
KeQuerySystemTime(&SystemTime);
|
||||
|
||||
current_entry = RelativeTimerListHead.Flink;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: virtual.c,v 1.74 2004/05/29 11:53:43 navaraf Exp $
|
||||
/* $Id: virtual.c,v 1.75 2004/06/13 10:35:52 navaraf Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/virtual.c
|
||||
|
@ -206,8 +206,8 @@ NtQueryVirtualMemory (IN HANDLE ProcessHandle,
|
|||
|
||||
NTSTATUS STDCALL
|
||||
NtProtectVirtualMemory(IN HANDLE ProcessHandle,
|
||||
IN PVOID BaseAddress,
|
||||
IN ULONG NumberOfBytesToProtect,
|
||||
IN PVOID *UnsafeBaseAddress,
|
||||
IN ULONG *UnsafeNumberOfBytesToProtect,
|
||||
IN ULONG NewAccessProtection,
|
||||
OUT PULONG UnsafeOldAccessProtection)
|
||||
{
|
||||
|
@ -216,6 +216,15 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle,
|
|||
NTSTATUS Status;
|
||||
PMADDRESS_SPACE AddressSpace;
|
||||
ULONG OldAccessProtection;
|
||||
PVOID BaseAddress;
|
||||
ULONG NumberOfBytesToProtect;
|
||||
|
||||
Status = MmCopyFromCaller(&BaseAddress, UnsafeBaseAddress, sizeof(PVOID));
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
Status = MmCopyFromCaller(&NumberOfBytesToProtect, UnsafeNumberOfBytesToProtect, sizeof(ULONG));
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
NumberOfBytesToProtect =
|
||||
PAGE_ROUND_UP(BaseAddress + NumberOfBytesToProtect) -
|
||||
|
@ -228,7 +237,7 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle,
|
|||
UserMode,
|
||||
(PVOID*)(&Process),
|
||||
NULL);
|
||||
if (Status != STATUS_SUCCESS)
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("NtProtectVirtualMemory() = %x\n",Status);
|
||||
return(Status);
|
||||
|
@ -263,8 +272,9 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle,
|
|||
MmUnlockAddressSpace(AddressSpace);
|
||||
ObDereferenceObject(Process);
|
||||
|
||||
MmCopyToCaller(UnsafeOldAccessProtection, &OldAccessProtection,
|
||||
sizeof(ULONG));
|
||||
MmCopyToCaller(UnsafeOldAccessProtection, &OldAccessProtection, sizeof(ULONG));
|
||||
MmCopyToCaller(UnsafeBaseAddress, &BaseAddress, sizeof(PVOID));
|
||||
MmCopyToCaller(UnsafeNumberOfBytesToProtect, &NumberOfBytesToProtect, sizeof(ULONG));
|
||||
|
||||
return(Status);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.def,v 1.183 2004/05/28 21:16:27 royce Exp $
|
||||
; $Id: ntoskrnl.def,v 1.184 2004/06/13 10:35:53 navaraf Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -559,7 +559,7 @@ NlsLeadByteInfo DATA
|
|||
NlsMbCodePageTag DATA
|
||||
NlsMbOemCodePageTag DATA
|
||||
NlsOemLeadByteInfo DATA
|
||||
NtAddAtom@8
|
||||
NtAddAtom@12
|
||||
NtAdjustPrivilegesToken@24
|
||||
NtAlertThread@4
|
||||
NtAllocateLocallyUniqueId@4
|
||||
|
@ -578,7 +578,7 @@ NtDeleteFile@4
|
|||
NtDeviceIoControlFile@40
|
||||
NtDuplicateObject@28
|
||||
NtDuplicateToken@24
|
||||
NtFindAtom@8
|
||||
NtFindAtom@12
|
||||
NtFreeVirtualMemory@16
|
||||
NtFsControlFile@40
|
||||
NtGlobalFlag DATA
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.edf,v 1.169 2004/05/28 21:16:27 royce Exp $
|
||||
; $Id: ntoskrnl.edf,v 1.170 2004/06/13 10:35:53 navaraf Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -560,7 +560,7 @@ NlsLeadByteInfo DATA
|
|||
NlsMbCodePageTag DATA
|
||||
NlsMbOemCodePageTag DATA
|
||||
NlsOemLeadByteInfo DATA
|
||||
NtAddAtom=NtAddAtom@8
|
||||
NtAddAtom=NtAddAtom@12
|
||||
NtAdjustPrivilegesToken=NtAdjustPrivilegesToken@24
|
||||
NtAlertThread=NtAlertThread@4
|
||||
NtAllocateLocallyUniqueId=NtAllocateLocallyUniqueId@4
|
||||
|
@ -579,7 +579,7 @@ NtDeleteFile=NtDeleteFile@4
|
|||
NtDeviceIoControlFile=NtDeviceIoControlFile@40
|
||||
NtDuplicateObject=NtDuplicateObject@28
|
||||
NtDuplicateToken=NtDuplicateToken@24
|
||||
NtFindAtom=NtFindAtom@8
|
||||
NtFindAtom=NtFindAtom@12
|
||||
NtFreeVirtualMemory=NtFreeVirtualMemory@16
|
||||
NtFsControlFile=NtFsControlFile@40
|
||||
NtGlobalFlag DATA
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: atom.c,v 1.9 2004/02/27 23:11:32 gvg Exp $
|
||||
/* $Id: atom.c,v 1.10 2004/06/13 10:35:53 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -67,18 +67,18 @@ static PRTL_ATOM_TABLE GlobalAtomTable = NULL;
|
|||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL
|
||||
NtAddAtom(IN PWSTR AtomName,
|
||||
OUT PRTL_ATOM Atom)
|
||||
NtAddAtom(
|
||||
IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
OUT PRTL_ATOM Atom)
|
||||
{
|
||||
PRTL_ATOM_TABLE AtomTable;
|
||||
|
||||
AtomTable = RtlpGetGlobalAtomTable();
|
||||
if (AtomTable == NULL)
|
||||
return STATUS_ACCESS_DENIED;
|
||||
return STATUS_ACCESS_DENIED;
|
||||
|
||||
return (RtlAddAtomToAtomTable(AtomTable,
|
||||
AtomName,
|
||||
Atom));
|
||||
return RtlAddAtomToAtomTable(AtomTable, AtomName, Atom);
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +104,7 @@ NtDeleteAtom(IN RTL_ATOM Atom)
|
|||
*/
|
||||
NTSTATUS STDCALL
|
||||
NtFindAtom(IN PWSTR AtomName,
|
||||
IN ULONG AtomNameLength,
|
||||
OUT PRTL_ATOM Atom)
|
||||
{
|
||||
PRTL_ATOM_TABLE AtomTable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue