mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 17:35:07 +00:00
Build kernel32 with NDK
svn path=/trunk/; revision=16134
This commit is contained in:
parent
d98066b2aa
commit
497256b40e
|
@ -578,7 +578,7 @@ GetShortPathNameW (
|
|||
DWORD shortlen
|
||||
)
|
||||
{
|
||||
WCHAR tmpshortpath[PATH_MAX];
|
||||
WCHAR tmpshortpath[MAX_PATH];
|
||||
LPCWSTR p;
|
||||
DWORD sp = 0, lp = 0;
|
||||
DWORD tmplen;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <k32.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include "../include/debug.h"
|
||||
|
|
|
@ -177,7 +177,7 @@ CreateNamedPipeW(LPCWSTR lpName,
|
|||
|
||||
if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES)
|
||||
{
|
||||
nMaxInstances = ULONG_MAX;
|
||||
nMaxInstances = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL;
|
||||
|
|
|
@ -1,38 +1,49 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS System Libraries
|
||||
* FILE: lib/ntdll/inc/ntdll.h
|
||||
* PURPOSE: Native Libary Header
|
||||
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
/* PSDK/NDK Headers */
|
||||
#include <windows.h>
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <limits.h>
|
||||
#include <ndk/ntndk.h>
|
||||
|
||||
/* C Headers */
|
||||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
/* DDK Driver Headers */
|
||||
#include <ddk/ntddbeep.h>
|
||||
#include <ddk/ntddser.h>
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <ddk/ntddtape.h>
|
||||
|
||||
/* FIXME: Clean this sh*t up */
|
||||
#include <ntdll/base.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <ntdll/dbg.h>
|
||||
#include <ntdll/csr.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <napi/i386/segment.h>
|
||||
#include <napi/teb.h>
|
||||
#include <napi/npipe.h>
|
||||
#include <napi/types.h>
|
||||
#include <csrss/csrss.h>
|
||||
#include <reactos/buildno.h>
|
||||
#include <rosrtl/thread.h>
|
||||
#include <rosrtl/string.h>
|
||||
#include <ntos/ldrtypes.h>
|
||||
#include <ntos/zwtypes.h>
|
||||
#include <ddk/ldrfuncs.h>
|
||||
#include <ddk/ntifs.h>
|
||||
|
||||
/* Toolhelp & CSRSS Header */
|
||||
#include <tlhelp32.h>
|
||||
#include <csrss/csrss.h>
|
||||
|
||||
/* FIXME: KILL ROSRTL */
|
||||
#include <rosrtl/thread.h>
|
||||
#include <rosrtl/string.h>
|
||||
#include <rosrtl/registry.h>
|
||||
|
||||
/* Internal Kernel32 Header */
|
||||
#include "include/kernel32.h"
|
||||
|
||||
/* PSEH for SEH Support */
|
||||
#include <pseh.h>
|
||||
|
||||
/* Helper Header */
|
||||
#include <reactos/helper.h>
|
||||
#include <reactos/buildno.h>
|
||||
|
||||
|
|
|
@ -407,38 +407,38 @@ GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
|
|||
*/
|
||||
lpBuffer->dwMemoryLoad = (SysBasicInfo.NumberOfPhysicalPages -
|
||||
SysPerfInfo.AvailablePages) * 100 /
|
||||
SysBasicInfo.NumberOfPhysicalPages;
|
||||
SysBasicInfo.PageSize;
|
||||
|
||||
DPRINT1("Memory Load: %d\n",lpBuffer->dwMemoryLoad );
|
||||
|
||||
lpBuffer->ullTotalPhys = SysBasicInfo.NumberOfPhysicalPages *
|
||||
SysBasicInfo.PhysicalPageSize;
|
||||
SysBasicInfo.PageSize;
|
||||
lpBuffer->ullAvailPhys = SysPerfInfo.AvailablePages *
|
||||
SysBasicInfo.PhysicalPageSize;
|
||||
SysBasicInfo.PageSize;
|
||||
|
||||
DPRINT("%d\n",SysPerfInfo.AvailablePages );
|
||||
DPRINT("%d\n",lpBuffer->ullAvailPhys );
|
||||
|
||||
lpBuffer->ullTotalPageFile = SysPerfInfo.TotalCommitLimit *
|
||||
SysBasicInfo.PhysicalPageSize;
|
||||
lpBuffer->ullTotalPageFile = SysPerfInfo.CommitLimit *
|
||||
SysBasicInfo.PageSize;
|
||||
|
||||
DPRINT("%d\n",lpBuffer->ullTotalPageFile );
|
||||
|
||||
lpBuffer->ullAvailPageFile = ((SysPerfInfo.TotalCommitLimit -
|
||||
SysPerfInfo.TotalCommittedPages) *
|
||||
SysBasicInfo.PhysicalPageSize);
|
||||
lpBuffer->ullAvailPageFile = ((SysPerfInfo.CommitLimit -
|
||||
SysPerfInfo.CommittedPages) *
|
||||
SysBasicInfo.PageSize);
|
||||
|
||||
/* VM available to the calling processes, User Mem? */
|
||||
lpBuffer->ullTotalVirtual = SysBasicInfo.HighestUserAddress -
|
||||
SysBasicInfo.LowestUserAddress;
|
||||
lpBuffer->ullTotalVirtual = SysBasicInfo.MaximumUserModeAddress -
|
||||
SysBasicInfo.MinimumUserModeAddress;
|
||||
|
||||
lpBuffer->ullAvailVirtual = (lpBuffer->ullTotalVirtual -
|
||||
(UserMemory *
|
||||
SysBasicInfo.PhysicalPageSize));
|
||||
SysBasicInfo.PageSize));
|
||||
|
||||
DPRINT("%d\n",lpBuffer->ullAvailVirtual );
|
||||
DPRINT("%d\n",UserMemory);
|
||||
DPRINT("%d\n",SysBasicInfo.PhysicalPageSize);
|
||||
DPRINT("%d\n",SysBasicInfo.PageSize);
|
||||
|
||||
/* lol! Memory from beyond! */
|
||||
lpBuffer->ullAvailExtendedVirtual = 0;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#define NDEBUG
|
||||
#include "../include/debug.h"
|
||||
#include "lzexpand.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#define HFILE_ERROR ((HFILE)-1)
|
||||
|
||||
|
|
|
@ -58,11 +58,11 @@ GetSystemInfo (
|
|||
Si->wProcessorArchitecture = Spi.ProcessorArchitecture;
|
||||
/* For future use: always zero */
|
||||
Si->wReserved = 0;
|
||||
Si->dwPageSize = Sbi.PhysicalPageSize;
|
||||
Si->lpMinimumApplicationAddress = (PVOID)Sbi.LowestUserAddress;
|
||||
Si->lpMaximumApplicationAddress = (PVOID)Sbi.HighestUserAddress;
|
||||
Si->dwActiveProcessorMask = Sbi.ActiveProcessors;
|
||||
Si->dwNumberOfProcessors = Sbi.NumberProcessors;
|
||||
Si->dwPageSize = Sbi.PageSize;
|
||||
Si->lpMinimumApplicationAddress = (PVOID)Sbi.MinimumUserModeAddress;
|
||||
Si->lpMaximumApplicationAddress = (PVOID)Sbi.MaximumUserModeAddress;
|
||||
Si->dwActiveProcessorMask = Sbi.ActiveProcessorsAffinityMask;
|
||||
Si->dwNumberOfProcessors = Sbi.NumberOfProcessors;
|
||||
/*
|
||||
* Compatibility (no longer relevant):
|
||||
* PROCESSOR_INTEL_386 386
|
||||
|
|
|
@ -366,7 +366,7 @@ SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
|
|||
|
||||
DPRINT("SetTimeZoneInformation()\n");
|
||||
|
||||
Status = RtlSetTimeZoneInformation((PTIME_ZONE_INFORMATION)lpTimeZoneInformation);
|
||||
Status = RtlSetTimeZoneInformation((LPTIME_ZONE_INFORMATION)lpTimeZoneInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("RtlSetTimeZoneInformation() failed (Status %lx)\n", Status);
|
||||
|
@ -442,12 +442,12 @@ GetSystemTimeAdjustment(PDWORD lpTimeAdjustment,
|
|||
PDWORD lpTimeIncrement,
|
||||
PBOOL lpTimeAdjustmentDisabled)
|
||||
{
|
||||
SYSTEM_QUERY_TIME_ADJUSTMENT Buffer;
|
||||
SYSTEM_QUERY_TIME_ADJUST_INFORMATION Buffer;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation,
|
||||
&Buffer,
|
||||
sizeof(SYSTEM_QUERY_TIME_ADJUSTMENT),
|
||||
sizeof(SYSTEM_QUERY_TIME_ADJUST_INFORMATION),
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -456,8 +456,8 @@ GetSystemTimeAdjustment(PDWORD lpTimeAdjustment,
|
|||
}
|
||||
|
||||
*lpTimeAdjustment = (DWORD)Buffer.TimeAdjustment;
|
||||
*lpTimeIncrement = (DWORD)Buffer.MaximumIncrement;
|
||||
*lpTimeAdjustmentDisabled = (BOOL)Buffer.TimeSynchronization;
|
||||
*lpTimeIncrement = (DWORD)Buffer.TimeIncrement;
|
||||
*lpTimeAdjustmentDisabled = (BOOL)Buffer.Enable;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -471,14 +471,14 @@ SetSystemTimeAdjustment(DWORD dwTimeAdjustment,
|
|||
BOOL bTimeAdjustmentDisabled)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
SYSTEM_SET_TIME_ADJUSTMENT Buffer;
|
||||
SYSTEM_SET_TIME_ADJUST_INFORMATION Buffer;
|
||||
|
||||
Buffer.TimeAdjustment = (ULONG)dwTimeAdjustment;
|
||||
Buffer.TimeSynchronization = (BOOLEAN)bTimeAdjustmentDisabled;
|
||||
Buffer.Enable = (BOOLEAN)bTimeAdjustmentDisabled;
|
||||
|
||||
Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
|
||||
&Buffer,
|
||||
sizeof(SYSTEM_SET_TIME_ADJUSTMENT));
|
||||
sizeof(SYSTEM_SET_TIME_ADJUST_INFORMATION));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
|
|
|
@ -139,11 +139,11 @@ BOOL STDCALL CreateProcessA(LPCSTR lpApplicationName,
|
|||
BOOL bRetVal;
|
||||
STARTUPINFOW wsiStartupInfo;
|
||||
|
||||
NTSTATUS STDCALL_FUNC (*pTrue)(UNICODE_STRING *,
|
||||
NTSTATUS (STDCALL *pTrue)(UNICODE_STRING *,
|
||||
ANSI_STRING *,
|
||||
BOOLEAN);
|
||||
|
||||
ULONG STDCALL_FUNC (*pRtlMbStringToUnicodeSize)(ANSI_STRING *);
|
||||
ULONG (STDCALL *pRtlMbStringToUnicodeSize)(ANSI_STRING *);
|
||||
|
||||
DPRINT("dwCreationFlags %x, lpEnvironment %x, lpCurrentDirectory %x, "
|
||||
"lpStartupInfo %x, lpProcessInformation %x\n",
|
||||
|
@ -1156,7 +1156,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
|||
*/
|
||||
CsrRequest.Type = CSRSS_CREATE_PROCESS;
|
||||
CsrRequest.Data.CreateProcessRequest.NewProcessId =
|
||||
ProcessBasicInfo.UniqueProcessId;
|
||||
(HANDLE)ProcessBasicInfo.UniqueProcessId;
|
||||
if (Sii.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
||||
{
|
||||
/* Do not create a console for GUI applications */
|
||||
|
@ -1306,7 +1306,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
|||
if (IsConsoleHandle(Ppb->hStdError))
|
||||
{
|
||||
CsrRequest.Type = CSRSS_DUPLICATE_HANDLE;
|
||||
CsrRequest.Data.DuplicateHandleRequest.ProcessId = ProcessBasicInfo.UniqueProcessId;
|
||||
CsrRequest.Data.DuplicateHandleRequest.ProcessId = (HANDLE)ProcessBasicInfo.UniqueProcessId;
|
||||
CsrRequest.Data.DuplicateHandleRequest.Handle = CsrReply.Data.CreateProcessReply.OutputHandle;
|
||||
Status = CsrClientCallServer(&CsrRequest,
|
||||
&CsrReply,
|
||||
|
|
|
@ -62,7 +62,7 @@ GetProcessAffinityMask (HANDLE hProcess,
|
|||
}
|
||||
|
||||
*lpProcessAffinityMask = (DWORD)ProcessInfo.AffinityMask;
|
||||
*lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessors;
|
||||
*lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessorsAffinityMask;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue