git://git.jankratochvil.net
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1334f77
)
bootstrap
captive-0_1
author
lace
<>
Thu, 31 Oct 2002 14:41:55 +0000
(14:41 +0000)
committer
lace
<>
Thu, 31 Oct 2002 14:41:55 +0000
(14:41 +0000)
26 files changed:
.vimrc
[new file with mode: 0644]
patch
|
blob
drivers/bus/acpi/include/platform/types.h
patch
|
blob
|
history
include/ddk/cmtypes.h
patch
|
blob
|
history
include/ddk/ntddk.h
patch
|
blob
|
history
include/ddk/rtl.h
patch
|
blob
|
history
include/ntos/types.h
patch
|
blob
|
history
ntoskrnl/include/internal/kd.h
patch
|
blob
|
history
ntoskrnl/include/internal/ke.h
patch
|
blob
|
history
ntoskrnl/io/device.c
patch
|
blob
|
history
ntoskrnl/io/iomgr.c
patch
|
blob
|
history
ntoskrnl/io/shutdown.c
patch
|
blob
|
history
ntoskrnl/io/vpb.c
patch
|
blob
|
history
ntoskrnl/ke/kqueue.c
patch
|
blob
|
history
ntoskrnl/ldr/loader.c
patch
|
blob
|
history
ntoskrnl/ldr/rtl.c
patch
|
blob
|
history
ntoskrnl/ob/handle.c
patch
|
blob
|
history
ntoskrnl/ob/namespc.c
patch
|
blob
|
history
ntoskrnl/ob/object.c
patch
|
blob
|
history
ntoskrnl/ps/create.c
patch
|
blob
|
history
ntoskrnl/ps/process.c
patch
|
blob
|
history
ntoskrnl/ps/thread.c
patch
|
blob
|
history
ntoskrnl/rtl/mem.c
patch
|
blob
|
history
ntoskrnl/rtl/nls.c
patch
|
blob
|
history
ntoskrnl/rtl/sprintf.c
patch
|
blob
|
history
ntoskrnl/rtl/unicode.c
patch
|
blob
|
history
ntoskrnl/rtl/wstring.c
patch
|
blob
|
history
diff --git a/.vimrc
b/.vimrc
new file mode 100644
(file)
index 0000000..
6751a10
--- /dev/null
+++ b/
.vimrc
@@ -0,0
+1,2
@@
+set ts=8
+set sw=2
diff --git
a/drivers/bus/acpi/include/platform/types.h
b/drivers/bus/acpi/include/platform/types.h
index
6326448
..
ef4b439
100644
(file)
--- a/
drivers/bus/acpi/include/platform/types.h
+++ b/
drivers/bus/acpi/include/platform/types.h
@@
-86,6
+86,7
@@
typedef unsigned long long DWORD64, *PDWORD64;
typedef unsigned char UCHAR;
#endif
typedef unsigned short USHORT;
typedef unsigned char UCHAR;
#endif
typedef unsigned short USHORT;
+/* Yes, W32 uses 16-bit wchar_t requiring GCC -fshort-wchar option */
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
@@
-137,7
+138,7
@@
typedef CCHAR *PCCHAR;
typedef const unsigned short *PCWSTR;
typedef const unsigned short *PCWSTR;
-typedef char* PCSZ;
+typedef c
onst c
har* PCSZ;
typedef union _LARGE_INTEGER
{
typedef union _LARGE_INTEGER
{
@@
-455,6
+456,7
@@
typedef unsigned char UCHAR;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef unsigned short USHORT;
+/* Yes, W32 uses 16-bit wchar_t requiring GCC -fshort-wchar option */
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
diff --git
a/include/ddk/cmtypes.h
b/include/ddk/cmtypes.h
index
a9af321
..
fc87506
100644
(file)
--- a/
include/ddk/cmtypes.h
+++ b/
include/ddk/cmtypes.h
@@
-1,3
+1,11
@@
+#ifndef __DDK_CMTYPES_H
+#define __DDK_CMTYPES_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
/*
* Object Manager structures and typedefs
/*
* Object Manager structures and typedefs
@@
-98,3
+106,9
@@
typedef struct _KEY_VALUE_ENTRY
ULONG Type;
} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
ULONG Type;
} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __DDK_CMTYPES_H */
diff --git
a/include/ddk/ntddk.h
b/include/ddk/ntddk.h
index
fd8d199
..
8dcac67
100644
(file)
--- a/
include/ddk/ntddk.h
+++ b/
include/ddk/ntddk.h
@@
-19,10
+19,16
@@
extern "C"
/* INCLUDES ***************************************************************/
/* INCLUDES ***************************************************************/
+#ifndef FASTCALL
#define FASTCALL __attribute__((fastcall))
#define FASTCALL __attribute__((fastcall))
+#endif
#define STATIC static
#define STATIC static
+#ifndef REACTOS_UCS2
+#define REACTOS_UCS2(string_ucs2) (string_ucs2)
+#endif
+
#ifndef _GNU_H_WINDOWS_H
/* NASTY HACK! Our msvcrt are messed up, causing msvcrt.dll to crash when
* the headers are mixed with MinGW msvcrt headers. Not including stdlib.h
#ifndef _GNU_H_WINDOWS_H
/* NASTY HACK! Our msvcrt are messed up, causing msvcrt.dll to crash when
* the headers are mixed with MinGW msvcrt headers. Not including stdlib.h
diff --git
a/include/ddk/rtl.h
b/include/ddk/rtl.h
index
178977d
..
d600c76
100644
(file)
--- a/
include/ddk/rtl.h
+++ b/
include/ddk/rtl.h
@@
-1097,12
+1097,17
@@
RtlInitUnicodeStringFromLiteral (
*/
*/
+/* Prevent hide of the inappropriate passed type by our
+ * de"const" of the string in the macro below.
+ */
+static inline const WCHAR *_RtlInitUnicodeStringFromLiteral_typecheck(const WCHAR *s) { return s; }
+
#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \
InitializeUnicodeString( \
(__PDEST_STRING__), \
sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \
sizeof(__SOURCE_STRING__), \
#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \
InitializeUnicodeString( \
(__PDEST_STRING__), \
sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \
sizeof(__SOURCE_STRING__), \
- (
__SOURCE_STRING__
) \
+ (
WCHAR * /* de"const" the string here */ )_RtlInitUnicodeStringFromLiteral_typecheck((__SOURCE_STRING__)
) \
)
/*
)
/*
diff --git
a/include/ntos/types.h
b/include/ntos/types.h
index
ebdf60f
..
1375aea
100644
(file)
--- a/
include/ntos/types.h
+++ b/
include/ntos/types.h
@@
-80,6
+80,7
@@
typedef unsigned long long DWORD64, *PDWORD64;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
+/* Yes, W32 uses 16-bit wchar_t requiring GCC -fshort-wchar option */
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
typedef unsigned short WCHAR;
typedef unsigned short WORD;
typedef int BOOL;
@@
-115,8
+116,12
@@
typedef char CCHAR;
typedef CCHAR *PCCHAR;
typedef CCHAR *PCCHAR;
+#ifndef FALSE
#define FALSE 0
#define FALSE 0
+#endif
+#ifndef TRUE
#define TRUE 1
#define TRUE 1
+#endif
#ifndef NULL
#ifdef __cplusplus
#ifndef NULL
#ifdef __cplusplus
@@
-128,7
+133,7
@@
typedef CCHAR *PCCHAR;
typedef const unsigned short *PCWSTR;
typedef const unsigned short *PCWSTR;
-typedef char* PCSZ;
+typedef c
onst c
har* PCSZ;
typedef union _LARGE_INTEGER
{
typedef union _LARGE_INTEGER
{
diff --git
a/ntoskrnl/include/internal/kd.h
b/ntoskrnl/include/internal/kd.h
index
06d525d
..
e08f3f1
100644
(file)
--- a/
ntoskrnl/include/internal/kd.h
+++ b/
ntoskrnl/include/internal/kd.h
@@
-54,7
+54,7
@@
UCHAR
KdGetChar(VOID);
VOID
KdGetChar(VOID);
VOID
-KdGdbStubInit();
+KdGdbStubInit(
VOID
);
VOID
KdGdbDebugPrint (LPSTR Message);
VOID
KdGdbDebugPrint (LPSTR Message);
diff --git
a/ntoskrnl/include/internal/ke.h
b/ntoskrnl/include/internal/ke.h
index
102b9c5
..
9fb0d10
100644
(file)
--- a/
ntoskrnl/include/internal/ke.h
+++ b/
ntoskrnl/include/internal/ke.h
@@
-86,7
+86,7
@@
KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
PCONTEXT Context);
VOID
VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
PCONTEXT Context);
VOID
-KeApplicationProcessorInit();
+KeApplicationProcessorInit(
VOID
);
VOID
KePrepareForApplicationProcessorInit(ULONG id);
ULONG
VOID
KePrepareForApplicationProcessorInit(ULONG id);
ULONG
diff --git
a/ntoskrnl/io/device.c
b/ntoskrnl/io/device.c
index
a2ebf77
..
36b4a09
100644
(file)
--- a/
ntoskrnl/io/device.c
+++ b/
ntoskrnl/io/device.c
@@
-35,6
+35,8
@@
/* FUNCTIONS ***************************************************************/
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
IoAttachDeviceByPointer(IN PDEVICE_OBJECT SourceDevice,
IN PDEVICE_OBJECT TargetDevice)
NTSTATUS STDCALL
IoAttachDeviceByPointer(IN PDEVICE_OBJECT SourceDevice,
IN PDEVICE_OBJECT TargetDevice)
@@
-580,6
+582,7
@@
IopCreateDevice(PVOID ObjectBody,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
IoCreateDevice(PDRIVER_OBJECT DriverObject,
NTSTATUS STDCALL
IoCreateDevice(PDRIVER_OBJECT DriverObject,
@@
-706,6
+709,7
@@
IoCreateDevice(PDRIVER_OBJECT DriverObject,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS
STDCALL
NTSTATUS
STDCALL
@@
-733,5
+737,6
@@
IoQueryDeviceEnumInfo (
return 0;
}
return 0;
}
+#endif /* LIBCAPTIVE */
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/io/iomgr.c
b/ntoskrnl/io/iomgr.c
index
4c5a358
..
be4bf54
100644
(file)
--- a/
ntoskrnl/io/iomgr.c
+++ b/
ntoskrnl/io/iomgr.c
@@
-30,11
+30,13
@@
POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL;
POBJECT_TYPE EXPORTED IoFileObjectType = NULL;
POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL;
POBJECT_TYPE EXPORTED IoFileObjectType = NULL;
+#ifndef LIBCAPTIVE
ULONG EXPORTED IoReadOperationCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoReadTransferCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoWriteOperationCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoWriteTransferCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoStatisticsLock = 0; /* FIXME: unknown type */
ULONG EXPORTED IoReadOperationCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoReadTransferCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoWriteOperationCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoWriteTransferCount = 0; /* FIXME: unknown type */
ULONG EXPORTED IoStatisticsLock = 0; /* FIXME: unknown type */
+#endif /* LIBCAPTIVE */
static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
@@
-43,6
+45,8
@@
static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ,
/* FUNCTIONS ****************************************************************/
/* FUNCTIONS ****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID STDCALL
IopCloseFile(PVOID ObjectBody,
ULONG HandleCount)
VOID STDCALL
IopCloseFile(PVOID ObjectBody,
ULONG HandleCount)
@@
-111,15
+115,18
@@
IopDeleteFile(PVOID ObjectBody)
}
}
}
}
+#endif /* LIBCAPTIVE */
VOID IoInit (VOID)
{
VOID IoInit (VOID)
{
+#ifndef LIBCAPTIVE
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirName;
UNICODE_STRING LinkName;
HANDLE Handle;
IopInitDriverImplementation();
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirName;
UNICODE_STRING LinkName;
HANDLE Handle;
IopInitDriverImplementation();
+#endif /* LIBCAPTIVE */
/*
* Register iomgr types: DeviceObjectType
/*
* Register iomgr types: DeviceObjectType
@@
-143,10
+150,14
@@
VOID IoInit (VOID)
IoDeviceObjectType->Security = NULL;
IoDeviceObjectType->QueryName = NULL;
IoDeviceObjectType->OkayToClose = NULL;
IoDeviceObjectType->Security = NULL;
IoDeviceObjectType->QueryName = NULL;
IoDeviceObjectType->OkayToClose = NULL;
+#ifndef LIBCAPTIVE
IoDeviceObjectType->Create = IopCreateDevice;
IoDeviceObjectType->Create = IopCreateDevice;
+#else /* !LIBCAPTIVE */
+ IoDeviceObjectType->Create = NULL;
+#endif /* !LIBCAPTIVE */
IoDeviceObjectType->DuplicationNotify = NULL;
IoDeviceObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName,
L"Device"
);
+ RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName,
REACTOS_UCS2(L"Device")
);
/*
* Register iomgr types: FileObjectType
/*
* Register iomgr types: FileObjectType
@@
-164,17
+175,27
@@
VOID IoInit (VOID)
IoFileObjectType->Mapping = &IopFileMapping;
IoFileObjectType->Dump = NULL;
IoFileObjectType->Open = NULL;
IoFileObjectType->Mapping = &IopFileMapping;
IoFileObjectType->Dump = NULL;
IoFileObjectType->Open = NULL;
+#ifndef LIBCAPTIVE
IoFileObjectType->Close = IopCloseFile;
IoFileObjectType->Delete = IopDeleteFile;
IoFileObjectType->Close = IopCloseFile;
IoFileObjectType->Delete = IopDeleteFile;
+#else /* !LIBCAPTIVE */
+ IoFileObjectType->Close = NULL;
+ IoFileObjectType->Delete = NULL;
+#endif /* !LIBCAPTIVE */
IoFileObjectType->Parse = NULL;
IoFileObjectType->Security = NULL;
IoFileObjectType->QueryName = NULL;
IoFileObjectType->OkayToClose = NULL;
IoFileObjectType->Parse = NULL;
IoFileObjectType->Security = NULL;
IoFileObjectType->QueryName = NULL;
IoFileObjectType->OkayToClose = NULL;
+#ifndef LIBCAPTIVE
IoFileObjectType->Create = IopCreateFile;
IoFileObjectType->Create = IopCreateFile;
+#else /* !LIBCAPTIVE */
+ IoFileObjectType->Create = NULL;
+#endif /* !LIBCAPTIVE */
IoFileObjectType->DuplicationNotify = NULL;
IoFileObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName,
L"File"
);
+ RtlInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName,
REACTOS_UCS2(L"File")
);
+#ifndef LIBCAPTIVE
/*
* Create the '\Driver' object directory
*/
/*
* Create the '\Driver' object directory
*/
@@
-250,12
+271,14
@@
VOID IoInit (VOID)
IoInitCancelHandling();
IoInitSymbolicLinkImplementation();
IoInitFileSystemImplementation();
IoInitCancelHandling();
IoInitSymbolicLinkImplementation();
IoInitFileSystemImplementation();
+#endif /* LIBCAPTIVE */
IoInitVpbImplementation();
IoInitShutdownNotification();
/*
* Create link from '\DosDevices' to '\??' directory
*/
IoInitVpbImplementation();
IoInitShutdownNotification();
/*
* Create link from '\DosDevices' to '\??' directory
*/
+#ifndef LIBCAPTIVE
RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\DosDevices");
RtlInitUnicodeStringFromLiteral(&DirName,
RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\DosDevices");
RtlInitUnicodeStringFromLiteral(&DirName,
@@
-267,8
+290,10
@@
VOID IoInit (VOID)
* Initialize PnP manager
*/
PnpInit();
* Initialize PnP manager
*/
PnpInit();
+#endif /* LIBCAPTIVE */
}
}
+#ifndef LIBCAPTIVE
PGENERIC_MAPPING STDCALL
IoGetFileObjectGenericMapping(VOID)
PGENERIC_MAPPING STDCALL
IoGetFileObjectGenericMapping(VOID)
@@
-276,4
+301,6
@@
IoGetFileObjectGenericMapping(VOID)
return(&IopFileMapping);
}
return(&IopFileMapping);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/io/shutdown.c
b/ntoskrnl/io/shutdown.c
index
ef369b7
..
1023deb
100644
(file)
--- a/
ntoskrnl/io/shutdown.c
+++ b/
ntoskrnl/io/shutdown.c
@@
-38,6
+38,8
@@
VOID IoInitShutdownNotification (VOID)
KeInitializeSpinLock(&ShutdownListLock);
}
KeInitializeSpinLock(&ShutdownListLock);
}
+#ifndef LIBCAPTIVE
+
VOID IoShutdownRegisteredDevices(VOID)
{
PSHUTDOWN_ENTRY ShutdownEntry;
VOID IoShutdownRegisteredDevices(VOID)
{
PSHUTDOWN_ENTRY ShutdownEntry;
@@
-79,6
+81,8
@@
VOID IoShutdownRegisteredDevices(VOID)
}
}
}
}
+#endif /* LIBCAPTIVE */
+
NTSTATUS STDCALL IoRegisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
{
PSHUTDOWN_ENTRY Entry;
NTSTATUS STDCALL IoRegisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
{
PSHUTDOWN_ENTRY Entry;
diff --git
a/ntoskrnl/io/vpb.c
b/ntoskrnl/io/vpb.c
index
72744a5
..
09b7ab8
100644
(file)
--- a/
ntoskrnl/io/vpb.c
+++ b/
ntoskrnl/io/vpb.c
@@
-64,6
+64,7
@@
IoAttachVpb(PDEVICE_OBJECT DeviceObject)
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
NtQueryVolumeInformationFile(IN HANDLE FileHandle,
NTSTATUS STDCALL
NtQueryVolumeInformationFile(IN HANDLE FileHandle,
@@
-362,4
+363,6
@@
IoReleaseVpbSpinLock(IN KIRQL Irql)
Irql);
}
Irql);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ke/kqueue.c
b/ntoskrnl/ke/kqueue.c
index
6c8d685
..
859a01e
100644
(file)
--- a/
ntoskrnl/ke/kqueue.c
+++ b/
ntoskrnl/ke/kqueue.c
@@
-17,6
+17,8
@@
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID
InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After, PLIST_ENTRY Entry)
{
VOID
InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After, PLIST_ENTRY Entry)
{
@@
-137,6
+139,8
@@
KeRemoveDeviceQueue (
return(entry);
}
return(entry);
}
+#endif /* LIBCAPTIVE */
+
VOID
STDCALL
KeInitializeDeviceQueue (
VOID
STDCALL
KeInitializeDeviceQueue (
@@
-154,6
+158,8
@@
KeInitializeDeviceQueue (
KeInitializeSpinLock(&DeviceQueue->Lock);
}
KeInitializeSpinLock(&DeviceQueue->Lock);
}
+#ifndef LIBCAPTIVE
+
BOOLEAN
STDCALL
KeInsertDeviceQueue (
BOOLEAN
STDCALL
KeInsertDeviceQueue (
@@
-196,3
+202,5
@@
KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
UNIMPLEMENTED;
return(FALSE);
}
UNIMPLEMENTED;
return(FALSE);
}
+
+#endif /* LIBCAPTIVE */
diff --git
a/ntoskrnl/ldr/loader.c
b/ntoskrnl/ldr/loader.c
index
eba5f27
..
cf2b120
100644
(file)
--- a/
ntoskrnl/ldr/loader.c
+++ b/
ntoskrnl/ldr/loader.c
@@
-52,8
+52,10
@@
LIST_ENTRY ModuleListHead;
KSPIN_LOCK ModuleListLock;
LIST_ENTRY ModuleTextListHead;
KSPIN_LOCK ModuleListLock;
LIST_ENTRY ModuleTextListHead;
+#ifndef LIBCAPTIVE
STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
STATIC MODULE_TEXT_SECTION LdrHalTextSection;
STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
STATIC MODULE_TEXT_SECTION LdrHalTextSection;
+#endif /* LIBCAPTIVE */
ULONG_PTR LdrHalBase;
#define TAG_DRIVER_MEM TAG('D', 'R', 'V', 'M')
ULONG_PTR LdrHalBase;
#define TAG_DRIVER_MEM TAG('D', 'R', 'V', 'M')
@@
-88,10
+90,12
@@
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
PCHAR Name,
USHORT Hint);
PCHAR Name,
USHORT Hint);
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
PCHAR Name,
USHORT Hint);
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
PCHAR Name,
USHORT Hint);
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName);
static PVOID
LdrPEFixupForward(PCHAR ForwardName);
@@
-99,6
+103,8
@@
LdrPEFixupForward(PCHAR ForwardName);
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID
LdrInitDebug(PLOADER_MODULE Module, PWCH Name)
{
VOID
LdrInitDebug(PLOADER_MODULE Module, PWCH Name)
{
@@
-418,6
+424,7
@@
LdrLoadModule(PUNICODE_STRING Filename,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrUnloadModule(PMODULE_OBJECT ModuleObject)
NTSTATUS
LdrUnloadModule(PMODULE_OBJECT ModuleObject)
@@
-449,6
+456,7
@@
LdrUnloadModule(PMODULE_OBJECT ModuleObject)
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
NTSTATUS
LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
@@
-546,6
+554,7
@@
LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
return(Status);
}
return(Status);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrProcessModule(PVOID ModuleLoadBase,
NTSTATUS
LdrProcessModule(PVOID ModuleLoadBase,
@@
-583,6
+592,7
@@
LdrGetExportAddress(PMODULE_OBJECT ModuleObject,
}
}
}
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrpQueryModuleInformation(PVOID Buffer,
NTSTATUS
LdrpQueryModuleInformation(PVOID Buffer,
@@
-663,6
+673,7
@@
LdrpQueryModuleInformation(PVOID Buffer,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
static VOID
LdrpBuildModuleBaseName(PUNICODE_STRING BaseName,
static VOID
LdrpBuildModuleBaseName(PUNICODE_STRING BaseName,
@@
-970,10
+981,10
@@
LdrPEProcessModule(PVOID ModuleLoadBase,
{
NumRelocs = (RelocDir->SizeOfBlock - sizeof(RELOCATION_DIRECTORY)) /
sizeof(WORD);
{
NumRelocs = (RelocDir->SizeOfBlock - sizeof(RELOCATION_DIRECTORY)) /
sizeof(WORD);
-
/*
DPRINT("RelocDir at %08lx for VA %08lx with %08lx relocs\n",
+ DPRINT("RelocDir at %08lx for VA %08lx with %08lx relocs\n",
RelocDir,
RelocDir->VirtualAddress,
RelocDir,
RelocDir->VirtualAddress,
- NumRelocs);
*/
+ NumRelocs);
RelocEntry = (PRELOCATION_ENTRY) ((DWORD)RelocDir +
sizeof(RELOCATION_DIRECTORY));
for (Idx = 0; Idx < NumRelocs; Idx++)
RelocEntry = (PRELOCATION_ENTRY) ((DWORD)RelocDir +
sizeof(RELOCATION_DIRECTORY));
for (Idx = 0; Idx < NumRelocs; Idx++)
@@
-986,12
+997,12
@@
LdrPEProcessModule(PVOID ModuleLoadBase,
Type = (RelocEntry[Idx].TypeOffset >> 12) & 0xf;
RelocItem = (PDWORD)(DriverBase + RelocDir->VirtualAddress +
Offset);
Type = (RelocEntry[Idx].TypeOffset >> 12) & 0xf;
RelocItem = (PDWORD)(DriverBase + RelocDir->VirtualAddress +
Offset);
-
/*
DPRINT(" reloc at %08lx %x %s old:%08lx new:%08lx\n",
+
DPRINT(" reloc at %08lx %x %s old:%08lx new:%08lx\n",
RelocItem,
Type,
Type ? "HIGHLOW" : "ABS",
*RelocItem,
RelocItem,
Type,
Type ? "HIGHLOW" : "ABS",
*RelocItem,
- (*RelocItem) + RelocDelta);
*/
+ (*RelocItem) + RelocDelta);
if (Type == 3)
{
(*RelocItem) += RelocDelta;
if (Type == 3)
{
(*RelocItem) += RelocDelta;
@@
-1034,7
+1045,7
@@
LdrPEProcessModule(PVOID ModuleLoadBase,
if (LibraryModuleObject == NULL)
{
CPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
if (LibraryModuleObject == NULL)
{
CPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
- wcscpy(NameBuffer,
L"\\SystemRoot\\system32\\drivers\\"
);
+ wcscpy(NameBuffer,
REACTOS_UCS2(L"\\SystemRoot\\system32\\drivers\\")
);
wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject);
wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject);
@@
-1195,6
+1206,7
@@
LdrPEProcessModule(PVOID ModuleLoadBase,
return STATUS_SUCCESS;
}
return STATUS_SUCCESS;
}
+#ifndef LIBCAPTIVE
PVOID
LdrSafePEProcessModule(PVOID ModuleLoadBase,
PVOID
LdrSafePEProcessModule(PVOID ModuleLoadBase,
@@
-1435,6
+1447,7
@@
LdrSafePEProcessModule(PVOID ModuleLoadBase,
return(0);
}
return(0);
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
static PVOID
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
@@
-1494,8
+1507,12
@@
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
}
else /* use hint */
{
}
else /* use hint */
{
+#ifndef LIBCAPTIVE
ExportAddress = (PVOID) ((DWORD)ModuleObject->Base +
FunctionList[Hint - ExportDir->Base]);
ExportAddress = (PVOID) ((DWORD)ModuleObject->Base +
FunctionList[Hint - ExportDir->Base]);
+#else /* !LIBCAPTIVE */
+ /* Ordinals not supported by libcaptive */
+#endif /* !LIBCAPTIVE */
}
if (ExportAddress == NULL)
}
if (ExportAddress == NULL)
@@
-1509,6
+1526,7
@@
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
return(ExportAddress);
}
return(ExportAddress);
}
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
@@
-1570,6
+1588,7
@@
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
return ExportAddress;
}
return ExportAddress;
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName)
static PVOID
LdrPEFixupForward(PCHAR ForwardName)
diff --git
a/ntoskrnl/ldr/rtl.c
b/ntoskrnl/ldr/rtl.c
index
4427372
..
5112306
100644
(file)
--- a/
ntoskrnl/ldr/rtl.c
+++ b/
ntoskrnl/ldr/rtl.c
@@
-82,6
+82,7
@@
RtlImageDirectoryEntryToData (IN PVOID BaseAddress,
return NULL;
}
return NULL;
}
+#ifndef LIBCAPTIVE
PIMAGE_SECTION_HEADER
STDCALL
PIMAGE_SECTION_HEADER
STDCALL
@@
-232,4
+233,6
@@
LdrGetProcedureAddress (IN PVOID BaseAddress,
return STATUS_PROCEDURE_NOT_FOUND;
}
return STATUS_PROCEDURE_NOT_FOUND;
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ob/handle.c
b/ntoskrnl/ob/handle.c
index
8d3b679
..
db493f8
100644
(file)
--- a/
ntoskrnl/ob/handle.c
+++ b/
ntoskrnl/ob/handle.c
@@
-105,6
+105,8
@@
static PHANDLE_REP ObpGetObjectByHandle(PHANDLE_TABLE HandleTable, HANDLE h)
return(&(blk->handles[handle%HANDLE_BLOCK_ENTRIES]));
}
return(&(blk->handles[handle%HANDLE_BLOCK_ENTRIES]));
}
+#ifndef LIBCAPTIVE
+
NTSTATUS
ObDuplicateObject(PEPROCESS SourceProcess,
PEPROCESS TargetProcess,
NTSTATUS
ObDuplicateObject(PEPROCESS SourceProcess,
PEPROCESS TargetProcess,
@@
-362,6
+364,7
@@
VOID ObDeleteHandleTable(PEPROCESS Process)
}
}
}
}
+#endif /* LIBCAPTIVE */
VOID ObCreateHandleTable(PEPROCESS Parent,
BOOLEAN Inherit,
VOID ObCreateHandleTable(PEPROCESS Parent,
BOOLEAN Inherit,
@@
-693,7
+696,6
@@
ObReferenceObjectByHandle(HANDLE Handle,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
-
/**********************************************************************
* NAME EXPORTED
* NtClose
/**********************************************************************
* NAME EXPORTED
* NtClose
@@
-731,6
+733,8
@@
NTSTATUS STDCALL NtClose(HANDLE Handle)
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
ObInsertObject(PVOID Object,
PACCESS_STATE PassedAccessState,
NTSTATUS STDCALL
ObInsertObject(PVOID Object,
PACCESS_STATE PassedAccessState,
@@
-746,4
+750,6
@@
ObInsertObject(PVOID Object,
Handle));
}
Handle));
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ob/namespc.c
b/ntoskrnl/ob/namespc.c
index
de66216
..
dfc6f58
100644
(file)
--- a/
ntoskrnl/ob/namespc.c
+++ b/
ntoskrnl/ob/namespc.c
@@
-41,6
+41,8
@@
static GENERIC_MAPPING ObpTypeMapping = {
/* FUNCTIONS **************************************************************/
/* FUNCTIONS **************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
ULONG Attributes,
NTSTATUS STDCALL
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
ULONG Attributes,
@@
-155,6
+157,7
@@
ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
return Status;
}
return Status;
}
+#endif /* LIBCAPTIVE */
VOID
ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
VOID
ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
@@
-355,7
+358,7
@@
ObInit(VOID)
ObDirectoryType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
ObDirectoryType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
-
L"Directory"
);
+
REACTOS_UCS2(L"Directory")
);
/* create 'type' object type*/
ObTypeObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
/* create 'type' object type*/
ObTypeObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
@@
-380,7
+383,7
@@
ObInit(VOID)
ObTypeObjectType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
ObTypeObjectType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
-
L"ObjectType"
);
+
REACTOS_UCS2(L"ObjectType")
);
/* create root directory */
ObCreateObject(NULL,
/* create root directory */
ObCreateObject(NULL,
@@
-391,7
+394,7
@@
ObInit(VOID)
/* create '\ObjectTypes' directory */
RtlInitUnicodeStringFromLiteral(&Name,
/* create '\ObjectTypes' directory */
RtlInitUnicodeStringFromLiteral(&Name,
-
L"\\ObjectTypes"
);
+
REACTOS_UCS2(L"\\ObjectTypes")
);
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_PERMANENT,
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_PERMANENT,
@@
-418,7
+421,7
@@
ObpCreateTypeObject(POBJECT_TYPE ObjectType)
NTSTATUS Status;
DPRINT("ObjectType: %wZ\n", &ObjectType->TypeName);
NTSTATUS Status;
DPRINT("ObjectType: %wZ\n", &ObjectType->TypeName);
- wcscpy(NameString,
L"\\ObjectTypes\\"
);
+ wcscpy(NameString,
REACTOS_UCS2(L"\\ObjectTypes\\")
);
wcscat(NameString, ObjectType->TypeName.Buffer);
RtlInitUnicodeString(&Name,
NameString);
wcscat(NameString, ObjectType->TypeName.Buffer);
RtlInitUnicodeString(&Name,
NameString);
diff --git
a/ntoskrnl/ob/object.c
b/ntoskrnl/ob/object.c
index
7ac9996
..
04fb364
100644
(file)
--- a/
ntoskrnl/ob/object.c
+++ b/
ntoskrnl/ob/object.c
@@
-389,6
+389,7
@@
ObReferenceObjectByPointer(IN PVOID Object,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
ObOpenObjectByPointer(IN POBJECT Object,
NTSTATUS STDCALL
ObOpenObjectByPointer(IN POBJECT Object,
@@
-423,6
+424,7
@@
ObOpenObjectByPointer(IN POBJECT Object,
return STATUS_SUCCESS;
}
return STATUS_SUCCESS;
}
+#endif /* LIBCAPTIVE */
static NTSTATUS
ObpPerformRetentionChecks(POBJECT_HEADER Header)
static NTSTATUS
ObpPerformRetentionChecks(POBJECT_HEADER Header)
@@
-469,6
+471,7
@@
ObpPerformRetentionChecks(POBJECT_HEADER Header)
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
/**********************************************************************
* NAME EXPORTED
/**********************************************************************
* NAME EXPORTED
@@
-502,6
+505,7
@@
ObfReferenceObject(IN PVOID Object)
ObpPerformRetentionChecks(Header);
}
ObpPerformRetentionChecks(Header);
}
+#endif /* LIBCAPTIVE */
/**********************************************************************
* NAME EXPORTED
/**********************************************************************
* NAME EXPORTED
@@
-545,6
+549,7
@@
ObfDereferenceObject(IN PVOID Object)
ObpPerformRetentionChecks(Header);
}
ObpPerformRetentionChecks(Header);
}
+#ifndef LIBCAPTIVE
/**********************************************************************
* NAME EXPORTED
/**********************************************************************
* NAME EXPORTED
@@
-595,4
+600,6
@@
ObGetObjectHandleCount(PVOID Object)
return(Header->HandleCount);
}
return(Header->HandleCount);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ps/create.c
b/ntoskrnl/ps/create.c
index
72fa987
..
ae92739
100644
(file)
--- a/
ntoskrnl/ps/create.c
+++ b/
ntoskrnl/ps/create.c
@@
-41,14
+41,18
@@
extern ULONG PiNrThreads;
extern LIST_ENTRY PiThreadListHead;
extern LIST_ENTRY PiThreadListHead;
+#ifndef LIBCAPTIVE
#define MAX_THREAD_NOTIFY_ROUTINE_COUNT 8
static ULONG PiThreadNotifyRoutineCount = 0;
static PCREATE_THREAD_NOTIFY_ROUTINE
PiThreadNotifyRoutine[MAX_THREAD_NOTIFY_ROUTINE_COUNT];
#define MAX_THREAD_NOTIFY_ROUTINE_COUNT 8
static ULONG PiThreadNotifyRoutineCount = 0;
static PCREATE_THREAD_NOTIFY_ROUTINE
PiThreadNotifyRoutine[MAX_THREAD_NOTIFY_ROUTINE_COUNT];
+#endif /* LIBCAPTIVE */
/* FUNCTIONS ***************************************************************/
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
PsAssignImpersonationToken(PETHREAD Thread,
HANDLE TokenHandle)
NTSTATUS STDCALL
PsAssignImpersonationToken(PETHREAD Thread,
HANDLE TokenHandle)
@@
-301,6
+305,8
@@
PiDeleteThread(PVOID ObjectBody)
DPRINT("PiDeleteThread() finished\n");
}
DPRINT("PiDeleteThread() finished\n");
}
+#endif /* LIBCAPTIVE */
+
NTSTATUS
PsInitializeThread(HANDLE ProcessHandle,
PETHREAD* ThreadPtr,
NTSTATUS
PsInitializeThread(HANDLE ProcessHandle,
PETHREAD* ThreadPtr,
@@
-313,7
+319,9
@@
PsInitializeThread(HANDLE ProcessHandle,
NTSTATUS Status;
KIRQL oldIrql;
PEPROCESS Process;
NTSTATUS Status;
KIRQL oldIrql;
PEPROCESS Process;
+#ifndef LIBCAPTIVE
ULONG i;
ULONG i;
+#endif /* LIBCAPTIVE */
/*
* Reference process
/*
* Reference process
@@
-385,16
+393,19
@@
PsInitializeThread(HANDLE ProcessHandle,
Thread->Tcb.BasePriority = Thread->ThreadsProcess->Pcb.BasePriority;
Thread->Tcb.Priority = Thread->Tcb.BasePriority;
Thread->Tcb.BasePriority = Thread->ThreadsProcess->Pcb.BasePriority;
Thread->Tcb.Priority = Thread->Tcb.BasePriority;
+#ifndef LIBCAPTIVE
for (i = 0; i < PiThreadNotifyRoutineCount; i++)
{
PiThreadNotifyRoutine[i](Thread->Cid.UniqueProcess,
Thread->Cid.UniqueThread,
TRUE);
}
for (i = 0; i < PiThreadNotifyRoutineCount; i++)
{
PiThreadNotifyRoutine[i](Thread->Cid.UniqueProcess,
Thread->Cid.UniqueThread,
TRUE);
}
+#endif /* LIBCAPTIVE */
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
static NTSTATUS
PsCreateTeb(HANDLE ProcessHandle,
static NTSTATUS
PsCreateTeb(HANDLE ProcessHandle,
@@
-686,4
+697,6
@@
PsSetCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ps/process.c
b/ntoskrnl/ps/process.c
index
c0b094c
..
751e534
100644
(file)
--- a/
ntoskrnl/ps/process.c
+++ b/
ntoskrnl/ps/process.c
@@
-50,12
+50,15
@@
static GENERIC_MAPPING PiProcessMapping = {PROCESS_READ,
#define MAX_PROCESS_NOTIFY_ROUTINE_COUNT 8
#define MAX_PROCESS_NOTIFY_ROUTINE_COUNT 8
+#ifndef LIBCAPTIVE
static ULONG PiProcessNotifyRoutineCount = 0;
static PCREATE_PROCESS_NOTIFY_ROUTINE
PiProcessNotifyRoutine[MAX_PROCESS_NOTIFY_ROUTINE_COUNT];
static ULONG PiProcessNotifyRoutineCount = 0;
static PCREATE_PROCESS_NOTIFY_ROUTINE
PiProcessNotifyRoutine[MAX_PROCESS_NOTIFY_ROUTINE_COUNT];
+#endif /* LIBCAPTIVE */
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
PEPROCESS
PsGetNextProcess(PEPROCESS OldProcess)
PEPROCESS
PsGetNextProcess(PEPROCESS OldProcess)
@@
-191,6
+194,7
@@
PiKillMostProcesses(VOID)
KeReleaseSpinLock(&PsProcessListLock, oldIrql);
}
KeReleaseSpinLock(&PsProcessListLock, oldIrql);
}
+#endif /* LIBCAPTIVE */
VOID
PsInitProcessManagment(VOID)
VOID
PsInitProcessManagment(VOID)
@@
-216,7
+220,11
@@
PsInitProcessManagment(VOID)
PsProcessType->Dump = NULL;
PsProcessType->Open = NULL;
PsProcessType->Close = NULL;
PsProcessType->Dump = NULL;
PsProcessType->Open = NULL;
PsProcessType->Close = NULL;
+#ifndef LIBCAPTIVE
PsProcessType->Delete = PiDeleteProcess;
PsProcessType->Delete = PiDeleteProcess;
+#else
+ PsProcessType->Delete = NULL; /* never Delete PsInitialSystemProcess */
+#endif /* LIBCAPTIVE */
PsProcessType->Parse = NULL;
PsProcessType->Security = NULL;
PsProcessType->QueryName = NULL;
PsProcessType->Parse = NULL;
PsProcessType->Security = NULL;
PsProcessType->QueryName = NULL;
@@
-224,7
+232,7
@@
PsInitProcessManagment(VOID)
PsProcessType->Create = NULL;
PsProcessType->DuplicationNotify = NULL;
PsProcessType->Create = NULL;
PsProcessType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName,
L"Process"
);
+ RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName,
REACTOS_UCS2(L"Process")
);
InitializeListHead(&PsProcessListHead);
KeInitializeSpinLock(&PsProcessListLock);
InitializeListHead(&PsProcessListHead);
KeInitializeSpinLock(&PsProcessListLock);
@@
-245,17
+253,23
@@
PsInitProcessManagment(VOID)
/* System threads may run on any processor. */
PsInitialSystemProcess->Pcb.Affinity = 0xFFFFFFFF;
PsInitialSystemProcess->Pcb.BasePriority = PROCESS_PRIO_NORMAL;
/* System threads may run on any processor. */
PsInitialSystemProcess->Pcb.Affinity = 0xFFFFFFFF;
PsInitialSystemProcess->Pcb.BasePriority = PROCESS_PRIO_NORMAL;
+#ifndef LIBCAPTIVE
KeInitializeDispatcherHeader(&PsInitialSystemProcess->Pcb.DispatcherHeader,
InternalProcessType,
sizeof(EPROCESS),
FALSE);
KeInitializeDispatcherHeader(&PsInitialSystemProcess->Pcb.DispatcherHeader,
InternalProcessType,
sizeof(EPROCESS),
FALSE);
+#endif /* LIBCAPTIVE */
KProcess = &PsInitialSystemProcess->Pcb;
KProcess = &PsInitialSystemProcess->Pcb;
+#ifndef LIBCAPTIVE
MmInitializeAddressSpace(PsInitialSystemProcess,
&PsInitialSystemProcess->AddressSpace);
MmInitializeAddressSpace(PsInitialSystemProcess,
&PsInitialSystemProcess->AddressSpace);
+#endif /* LIBCAPTIVE */
ObCreateHandleTable(NULL,FALSE,PsInitialSystemProcess);
ObCreateHandleTable(NULL,FALSE,PsInitialSystemProcess);
+#ifndef LIBCAPTIVE
KProcess->DirectoryTableBase =
(LARGE_INTEGER)(LONGLONG)(ULONG)MmGetPageDirectory();
KProcess->DirectoryTableBase =
(LARGE_INTEGER)(LONGLONG)(ULONG)MmGetPageDirectory();
+#endif /* LIBCAPTIVE */
PsInitialSystemProcess->UniqueProcessId =
InterlockedIncrement(&PiNextProcessUniqueId);
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
PsInitialSystemProcess->UniqueProcessId =
InterlockedIncrement(&PiNextProcessUniqueId);
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
@@
-269,7
+283,9
@@
PsInitProcessManagment(VOID)
strcpy(PsInitialSystemProcess->ImageFileName, "SYSTEM");
strcpy(PsInitialSystemProcess->ImageFileName, "SYSTEM");
+#ifndef LIBCAPTIVE
SepCreateSystemProcessToken(PsInitialSystemProcess);
SepCreateSystemProcessToken(PsInitialSystemProcess);
+#endif /* LIBCAPTIVE */
ObCreateHandle(PsInitialSystemProcess,
PsInitialSystemProcess,
ObCreateHandle(PsInitialSystemProcess,
PsInitialSystemProcess,
@@
-278,6
+294,8
@@
PsInitProcessManagment(VOID)
&SystemProcessHandle);
}
&SystemProcessHandle);
}
+#ifndef LIBCAPTIVE
+
VOID STDCALL
PiDeleteProcess(PVOID ObjectBody)
{
VOID STDCALL
PiDeleteProcess(PVOID ObjectBody)
{
@@
-364,23
+382,31
@@
PsGetCurrentProcessId(VOID)
return((HANDLE)PsGetCurrentProcess()->UniqueProcessId);
}
return((HANDLE)PsGetCurrentProcess()->UniqueProcessId);
}
+#endif /* LIBCAPTIVE */
+
/*
* FUNCTION: Returns a pointer to the current process
*/
PEPROCESS STDCALL
PsGetCurrentProcess(VOID)
{
/*
* FUNCTION: Returns a pointer to the current process
*/
PEPROCESS STDCALL
PsGetCurrentProcess(VOID)
{
+#ifndef LIBCAPTIVE
if (PsGetCurrentThread() == NULL ||
PsGetCurrentThread()->ThreadsProcess == NULL)
{
if (PsGetCurrentThread() == NULL ||
PsGetCurrentThread()->ThreadsProcess == NULL)
{
+#endif /* LIBCAPTIVE */
return(PsInitialSystemProcess);
return(PsInitialSystemProcess);
+#ifndef LIBCAPTIVE
}
else
{
return(PsGetCurrentThread()->ThreadsProcess);
}
}
else
{
return(PsGetCurrentThread()->ThreadsProcess);
}
+#endif /* LIBCAPTIVE */
}
}
+#ifndef LIBCAPTIVE
+
PEPROCESS STDCALL
IoGetCurrentProcess(VOID)
{
PEPROCESS STDCALL
IoGetCurrentProcess(VOID)
{
@@
-1245,4
+1271,6
@@
PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/ps/thread.c
b/ntoskrnl/ps/thread.c
index
c4da6f3
..
a4b53c7
100644
(file)
--- a/
ntoskrnl/ps/thread.c
+++ b/
ntoskrnl/ps/thread.c
@@
-43,16
+43,20
@@
KSPIN_LOCK PiThreadListLock;
/*
* PURPOSE: List of threads associated with each priority level
*/
/*
* PURPOSE: List of threads associated with each priority level
*/
-LIST_ENTRY PiThreadListHead;
static LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
static BOOLEAN DoneInitYet = FALSE;
static LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
static BOOLEAN DoneInitYet = FALSE;
+LIST_ENTRY PiThreadListHead;
+#ifndef LIBCAPTIVE
static PETHREAD IdleThreads[MAXIMUM_PROCESSORS];
static PETHREAD IdleThreads[MAXIMUM_PROCESSORS];
+#endif /* LIBCAPTIVE */
ULONG PiNrThreads = 0;
ULONG PiNrThreads = 0;
+#ifndef LIBCAPTIVE
ULONG PiNrReadyThreads = 0;
static HANDLE PiReaperThreadHandle;
static KEVENT PiReaperThreadEvent;
static BOOL PiReaperThreadShouldTerminate = FALSE;
ULONG PiNrThreadsAwaitingReaping = 0;
ULONG PiNrReadyThreads = 0;
static HANDLE PiReaperThreadHandle;
static KEVENT PiReaperThreadEvent;
static BOOL PiReaperThreadShouldTerminate = FALSE;
ULONG PiNrThreadsAwaitingReaping = 0;
+#endif /* LIBCAPTIVE */
static GENERIC_MAPPING PiThreadMapping = {THREAD_READ,
THREAD_WRITE,
static GENERIC_MAPPING PiThreadMapping = {THREAD_READ,
THREAD_WRITE,
@@
-61,17
+65,23
@@
static GENERIC_MAPPING PiThreadMapping = {THREAD_READ,
/* FUNCTIONS ***************************************************************/
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
PKTHREAD STDCALL KeGetCurrentThread(VOID)
{
return(KeGetCurrentKPCR()->CurrentThread);
}
PKTHREAD STDCALL KeGetCurrentThread(VOID)
{
return(KeGetCurrentKPCR()->CurrentThread);
}
+#endif /* LIBCAPTIVE */
+
PETHREAD STDCALL PsGetCurrentThread(VOID)
{
PKTHREAD CurrentThread = KeGetCurrentKPCR()->CurrentThread;
return(CONTAINING_RECORD(CurrentThread, ETHREAD, Tcb));
}
PETHREAD STDCALL PsGetCurrentThread(VOID)
{
PKTHREAD CurrentThread = KeGetCurrentKPCR()->CurrentThread;
return(CONTAINING_RECORD(CurrentThread, ETHREAD, Tcb));
}
+#ifndef LIBCAPTIVE
+
HANDLE STDCALL PsGetCurrentThreadId(VOID)
{
return(PsGetCurrentThread()->Cid.UniqueThread);
HANDLE STDCALL PsGetCurrentThreadId(VOID)
{
return(PsGetCurrentThread()->Cid.UniqueThread);
@@
-393,6
+403,8
@@
PsPrepareForApplicationProcessorInit(ULONG Id)
Id, IdleThread->Cid.UniqueThread);
}
Id, IdleThread->Cid.UniqueThread);
}
+#endif /* LIBCAPTIVE */
+
VOID
PsInitThreadManagment(VOID)
/*
VOID
PsInitThreadManagment(VOID)
/*
@@
-402,7
+414,9
@@
PsInitThreadManagment(VOID)
PETHREAD FirstThread;
ULONG i;
HANDLE FirstThreadHandle;
PETHREAD FirstThread;
ULONG i;
HANDLE FirstThreadHandle;
+#ifndef LIBCAPTIVE
NTSTATUS Status;
NTSTATUS Status;
+#endif /* LIBCAPTIVE */
KeInitializeSpinLock(&PiThreadListLock);
for (i=0; i < MAXIMUM_PRIORITY; i++)
KeInitializeSpinLock(&PiThreadListLock);
for (i=0; i < MAXIMUM_PRIORITY; i++)
@@
-414,7
+428,7
@@
PsInitThreadManagment(VOID)
PsThreadType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
PsThreadType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
- RtlInitUnicodeStringFromLiteral(&PsThreadType->TypeName,
L"Thread"
);
+ RtlInitUnicodeStringFromLiteral(&PsThreadType->TypeName,
REACTOS_UCS2(L"Thread")
);
PsThreadType->Tag = TAG('T', 'H', 'R', 'T');
PsThreadType->TotalObjects = 0;
PsThreadType->Tag = TAG('T', 'H', 'R', 'T');
PsThreadType->TotalObjects = 0;
@@
-427,7
+441,11
@@
PsInitThreadManagment(VOID)
PsThreadType->Dump = NULL;
PsThreadType->Open = NULL;
PsThreadType->Close = NULL;
PsThreadType->Dump = NULL;
PsThreadType->Open = NULL;
PsThreadType->Close = NULL;
+#ifndef LIBCAPTIVE
PsThreadType->Delete = PiDeleteThread;
PsThreadType->Delete = PiDeleteThread;
+#else /* !LIBCAPTIVE */
+ PsThreadType->Delete = NULL;
+#endif /* !LIBCAPTIVE */
PsThreadType->Parse = NULL;
PsThreadType->Security = NULL;
PsThreadType->QueryName = NULL;
PsThreadType->Parse = NULL;
PsThreadType->Security = NULL;
PsThreadType->QueryName = NULL;
@@
-446,6
+464,7
@@
PsInitThreadManagment(VOID)
DoneInitYet = TRUE;
DoneInitYet = TRUE;
+#ifndef LIBCAPTIVE
/*
* Create the reaper thread
*/
/*
* Create the reaper thread
*/
@@
-462,8
+481,11
@@
PsInitThreadManagment(VOID)
DPRINT1("PS: Failed to create reaper thread.\n");
KeBugCheck(0);
}
DPRINT1("PS: Failed to create reaper thread.\n");
KeBugCheck(0);
}
+#endif /* LIBCAPTIVE */
}
}
+#ifndef LIBCAPTIVE
+
LONG STDCALL
KeSetBasePriorityThread (PKTHREAD Thread,
LONG Increment)
LONG STDCALL
KeSetBasePriorityThread (PKTHREAD Thread,
LONG Increment)
@@
-647,4
+669,6
@@
PsLookupThreadByThreadId(IN PVOID ThreadId,
return(STATUS_INVALID_PARAMETER);
}
return(STATUS_INVALID_PARAMETER);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* EOF */
diff --git
a/ntoskrnl/rtl/mem.c
b/ntoskrnl/rtl/mem.c
index
dfdbdd7
..
5f73fbf
100644
(file)
--- a/
ntoskrnl/rtl/mem.c
+++ b/
ntoskrnl/rtl/mem.c
@@
-19,6
+19,8
@@
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
MmCopyToCaller(PVOID Dest, PVOID Src, ULONG NumberOfBytes)
{
NTSTATUS STDCALL
MmCopyToCaller(PVOID Dest, PVOID Src, ULONG NumberOfBytes)
{
@@
-78,7
+80,7
@@
RtlCompareMemory (
* RETURNS: Number of equal bytes
*/
{
* RETURNS: Number of equal bytes
*/
{
-
int
i,total;
+
ULONG
i,total;
for (i=0,total=0;i<Length;i++)
{
for (i=0,total=0;i<Length;i++)
{
@@
-109,7
+111,7
@@
RtlCompareMemoryUlong (
{
PULONG ptr = (PULONG)Source;
ULONG len = Length / sizeof(ULONG);
{
PULONG ptr = (PULONG)Source;
ULONG len = Length / sizeof(ULONG);
-
int
i;
+
ULONG
i;
for (i = 0; i < len; i++)
{
for (i = 0; i < len; i++)
{
@@
-141,6
+143,8
@@
VOID RtlCopyMemory(VOID* Destination, CONST VOID* Source, ULONG Length)
}
#endif
}
#endif
+#endif /* LIBCAPTIVE */
+
VOID
STDCALL
RtlFillMemory (
VOID
STDCALL
RtlFillMemory (
@@
-152,6
+156,7
@@
RtlFillMemory (
memset(Destination,Fill,Length);
}
memset(Destination,Fill,Length);
}
+#ifndef LIBCAPTIVE
VOID
STDCALL
VOID
STDCALL
@@
-188,6
+193,7
@@
RtlMoveMemory (
);
}
);
}
+#endif /* LIBCAPTIVE */
VOID
STDCALL
VOID
STDCALL
diff --git
a/ntoskrnl/rtl/nls.c
b/ntoskrnl/rtl/nls.c
index
e78be44
..
a97eb29
100644
(file)
--- a/
ntoskrnl/rtl/nls.c
+++ b/
ntoskrnl/rtl/nls.c
@@
-142,6
+142,7
@@
RtlpInitNlsTables(VOID)
}
}
+#ifndef LIBCAPTIVE
NTSTATUS
RtlpInitNlsSections(ULONG Mod1Start,
NTSTATUS
RtlpInitNlsSections(ULONG Mod1Start,
@@
-261,6
+262,7
@@
RtlGetDefaultCodePage(PUSHORT AnsiCodePage,
*OemCodePage = NlsOemCodePage;
}
*OemCodePage = NlsOemCodePage;
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
NTSTATUS STDCALL
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
@@
-357,6
+359,7
@@
RtlOemToUnicodeN(PWCHAR UnicodeString,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
RtlUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
NTSTATUS STDCALL
RtlUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
@@
-396,6
+399,7
@@
RtlUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
STDCALL
NTSTATUS
STDCALL
@@
-493,6
+497,7
@@
RtlUnicodeToOemN(PCHAR OemString,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
RtlUpcaseUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
NTSTATUS STDCALL
RtlUpcaseUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
@@
-534,6
+539,7
@@
RtlUpcaseUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
NTSTATUS STDCALL
RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
diff --git
a/ntoskrnl/rtl/sprintf.c
b/ntoskrnl/rtl/sprintf.c
index
259a897
..
ca26c98
100644
(file)
--- a/
ntoskrnl/rtl/sprintf.c
+++ b/
ntoskrnl/rtl/sprintf.c
@@
-201,7
+201,7
@@
stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int p
int i;
if (sw == NULL)
{
int i;
if (sw == NULL)
{
- sw =
L"<NULL>"
;
+ sw =
REACTOS_UCS2(L"<NULL>")
;
len = 6;
}
else
len = 6;
}
else
diff --git
a/ntoskrnl/rtl/unicode.c
b/ntoskrnl/rtl/unicode.c
index
705e7cc
..
e4797e1
100644
(file)
--- a/
ntoskrnl/rtl/unicode.c
+++ b/
ntoskrnl/rtl/unicode.c
@@
-11,7
+11,7
@@
#include <ddk/ntddk.h>
//#include <internal/nls.h>
#include <ddk/ntddk.h>
//#include <internal/nls.h>
-#include <
ctype.h>
+#include <
msvcrt/ctype.h> /* <ctype.h> does not need to define isw*() */
#include <ntos/minmax.h>
#include <internal/pool.h>
#include <ntos/minmax.h>
#include <internal/pool.h>
@@
-735,7
+735,7
@@
RtlIntegerToChar(IN ULONG Value,
tp++;
}
tp++;
}
- if (
tp - temp
>= Length)
+ if (
(ULONG)(tp - temp)
>= Length)
return STATUS_BUFFER_TOO_SMALL;
sp = String;
return STATUS_BUFFER_TOO_SMALL;
sp = String;
diff --git
a/ntoskrnl/rtl/wstring.c
b/ntoskrnl/rtl/wstring.c
index
ee59a51
..
f449ca9
100644
(file)
--- a/
ntoskrnl/rtl/wstring.c
+++ b/
ntoskrnl/rtl/wstring.c
@@
-29,6
+29,8
@@
int _wcsicmp (const wchar_t* cs, const wchar_t* ct)
return *cs - *ct;
}
return *cs - *ct;
}
+#ifndef LIBCAPTIVE
+
wchar_t *_wcslwr (wchar_t *x)
{
wchar_t *y=x;
wchar_t *_wcslwr (wchar_t *x)
{
wchar_t *y=x;
@@
-101,6
+103,7
@@
wchar_t *_wcsupr(wchar_t *x)
return x;
}
return x;
}
+#endif /* LIBCAPTIVE */
wchar_t * wcscat(wchar_t *dest, const wchar_t *src)
{
wchar_t * wcscat(wchar_t *dest, const wchar_t *src)
{
@@
-131,6
+134,7
@@
wchar_t * wcschr(const wchar_t *str, wchar_t ch)
return NULL;
}
return NULL;
}
+#ifndef LIBCAPTIVE
int wcscmp(const wchar_t *cs, const wchar_t *ct)
{
int wcscmp(const wchar_t *cs, const wchar_t *ct)
{
@@
-142,6
+146,7
@@
int wcscmp(const wchar_t *cs, const wchar_t *ct)
return *cs - *ct;
}
return *cs - *ct;
}
+#endif /* LIBCAPTIVE */
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
{
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
{
@@
-157,6
+162,7
@@
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
return(str1);
}
return(str1);
}
+#ifndef LIBCAPTIVE
size_t wcscspn(const wchar_t *str,const wchar_t *reject)
{
size_t wcscspn(const wchar_t *str,const wchar_t *reject)
{
@@
-177,6
+183,7
@@
size_t wcscspn(const wchar_t *str,const wchar_t *reject)
return s-str; /* nr of wchars */
}
return s-str; /* nr of wchars */
}
+#endif /* LIBCAPTIVE */
size_t wcslen(const wchar_t *s)
{
size_t wcslen(const wchar_t *s)
{
@@
-190,6
+197,7
@@
size_t wcslen(const wchar_t *s)
return len;
}
return len;
}
+#ifndef LIBCAPTIVE
wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
{
wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
{
@@
-239,6
+247,7
@@
wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t count)
return dest;
}
return dest;
}
+#endif /* LIBCAPTIVE */
wchar_t *wcsrchr(const wchar_t *str, wchar_t ch)
{
wchar_t *wcsrchr(const wchar_t *str, wchar_t ch)
{
@@
-259,6
+268,7
@@
wchar_t *wcsrchr(const wchar_t *str, wchar_t ch)
return NULL;
}
return NULL;
}
+#ifndef LIBCAPTIVE
size_t wcsspn(const wchar_t *str,const wchar_t *accept)
{
size_t wcsspn(const wchar_t *str,const wchar_t *accept)
{
@@
-306,3
+316,5
@@
wchar_t *wcsstr(const wchar_t *s,const wchar_t *b)
}
return NULL;
}
}
return NULL;
}
+
+#endif /* LIBCAPTIVE */