--- /dev/null
+set ts=8
+set sw=2
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 const unsigned short *PCWSTR;
-typedef char* PCSZ;
+typedef const char* PCSZ;
typedef union _LARGE_INTEGER
{
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;
+#ifndef __DDK_CMTYPES_H
+#define __DDK_CMTYPES_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
/*
* Object Manager structures and typedefs
ULONG Type;
} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __DDK_CMTYPES_H */
/* INCLUDES ***************************************************************/
+#ifndef FASTCALL
#define FASTCALL __attribute__((fastcall))
+#endif
#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
*/
+/* 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__), \
- (__SOURCE_STRING__) \
+ (WCHAR * /* de"const" the string here */ )_RtlInitUnicodeStringFromLiteral_typecheck((__SOURCE_STRING__)) \
)
/*
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 CCHAR *PCCHAR;
+#ifndef FALSE
#define FALSE 0
+#endif
+#ifndef TRUE
#define TRUE 1
+#endif
#ifndef NULL
#ifdef __cplusplus
typedef const unsigned short *PCWSTR;
-typedef char* PCSZ;
+typedef const char* PCSZ;
typedef union _LARGE_INTEGER
{
KdGetChar(VOID);
VOID
-KdGdbStubInit();
+KdGdbStubInit(VOID);
VOID
KdGdbDebugPrint (LPSTR Message);
VOID KeTrapFrameToContext(PKTRAP_FRAME TrapFrame,
PCONTEXT Context);
VOID
-KeApplicationProcessorInit();
+KeApplicationProcessorInit(VOID);
VOID
KePrepareForApplicationProcessorInit(ULONG id);
ULONG
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
IoAttachDeviceByPointer(IN PDEVICE_OBJECT SourceDevice,
IN PDEVICE_OBJECT TargetDevice)
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
IoCreateDevice(PDRIVER_OBJECT DriverObject,
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS
STDCALL
return 0;
}
+#endif /* LIBCAPTIVE */
/* EOF */
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 */
+#endif /* LIBCAPTIVE */
static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
/* FUNCTIONS ****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID STDCALL
IopCloseFile(PVOID ObjectBody,
ULONG HandleCount)
}
}
+#endif /* LIBCAPTIVE */
VOID IoInit (VOID)
{
+#ifndef LIBCAPTIVE
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirName;
UNICODE_STRING LinkName;
HANDLE Handle;
IopInitDriverImplementation();
+#endif /* LIBCAPTIVE */
/*
* Register iomgr types: DeviceObjectType
IoDeviceObjectType->Security = NULL;
IoDeviceObjectType->QueryName = NULL;
IoDeviceObjectType->OkayToClose = NULL;
+#ifndef LIBCAPTIVE
IoDeviceObjectType->Create = IopCreateDevice;
+#else /* !LIBCAPTIVE */
+ IoDeviceObjectType->Create = NULL;
+#endif /* !LIBCAPTIVE */
IoDeviceObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName, L"Device");
+ RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName, REACTOS_UCS2(L"Device"));
/*
* Register iomgr types: FileObjectType
IoFileObjectType->Mapping = &IopFileMapping;
IoFileObjectType->Dump = NULL;
IoFileObjectType->Open = NULL;
+#ifndef LIBCAPTIVE
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;
+#ifndef LIBCAPTIVE
IoFileObjectType->Create = IopCreateFile;
+#else /* !LIBCAPTIVE */
+ IoFileObjectType->Create = NULL;
+#endif /* !LIBCAPTIVE */
IoFileObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName, L"File");
+ RtlInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName, REACTOS_UCS2(L"File"));
+#ifndef LIBCAPTIVE
/*
* Create the '\Driver' object directory
*/
IoInitCancelHandling();
IoInitSymbolicLinkImplementation();
IoInitFileSystemImplementation();
+#endif /* LIBCAPTIVE */
IoInitVpbImplementation();
IoInitShutdownNotification();
/*
* Create link from '\DosDevices' to '\??' directory
*/
+#ifndef LIBCAPTIVE
RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\DosDevices");
RtlInitUnicodeStringFromLiteral(&DirName,
* Initialize PnP manager
*/
PnpInit();
+#endif /* LIBCAPTIVE */
}
+#ifndef LIBCAPTIVE
PGENERIC_MAPPING STDCALL
IoGetFileObjectGenericMapping(VOID)
return(&IopFileMapping);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
KeInitializeSpinLock(&ShutdownListLock);
}
+#ifndef LIBCAPTIVE
+
VOID IoShutdownRegisteredDevices(VOID)
{
PSHUTDOWN_ENTRY ShutdownEntry;
}
}
+#endif /* LIBCAPTIVE */
+
NTSTATUS STDCALL IoRegisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
{
PSHUTDOWN_ENTRY Entry;
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
NtQueryVolumeInformationFile(IN HANDLE FileHandle,
Irql);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID
InsertBeforeEntryInList(PLIST_ENTRY Head, PLIST_ENTRY After, PLIST_ENTRY Entry)
{
return(entry);
}
+#endif /* LIBCAPTIVE */
+
VOID
STDCALL
KeInitializeDeviceQueue (
KeInitializeSpinLock(&DeviceQueue->Lock);
}
+#ifndef LIBCAPTIVE
+
BOOLEAN
STDCALL
KeInsertDeviceQueue (
UNIMPLEMENTED;
return(FALSE);
}
+
+#endif /* LIBCAPTIVE */
KSPIN_LOCK ModuleListLock;
LIST_ENTRY ModuleTextListHead;
+#ifndef LIBCAPTIVE
STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
STATIC MODULE_TEXT_SECTION LdrHalTextSection;
+#endif /* LIBCAPTIVE */
ULONG_PTR LdrHalBase;
#define TAG_DRIVER_MEM TAG('D', 'R', 'V', 'M')
PCHAR Name,
USHORT Hint);
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
PCHAR Name,
USHORT Hint);
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName);
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID
LdrInitDebug(PLOADER_MODULE Module, PWCH Name)
{
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrUnloadModule(PMODULE_OBJECT ModuleObject)
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
return(Status);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrProcessModule(PVOID ModuleLoadBase,
}
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrpQueryModuleInformation(PVOID Buffer,
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
static VOID
LdrpBuildModuleBaseName(PUNICODE_STRING BaseName,
{
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,
- NumRelocs);*/
+ NumRelocs);
RelocEntry = (PRELOCATION_ENTRY) ((DWORD)RelocDir +
sizeof(RELOCATION_DIRECTORY));
for (Idx = 0; Idx < NumRelocs; Idx++)
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) + RelocDelta); */
+ (*RelocItem) + RelocDelta);
if (Type == 3)
{
(*RelocItem) += RelocDelta;
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);
return STATUS_SUCCESS;
}
+#ifndef LIBCAPTIVE
PVOID
LdrSafePEProcessModule(PVOID ModuleLoadBase,
return(0);
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
}
else /* use hint */
{
+#ifndef LIBCAPTIVE
ExportAddress = (PVOID) ((DWORD)ModuleObject->Base +
FunctionList[Hint - ExportDir->Base]);
+#else /* !LIBCAPTIVE */
+ /* Ordinals not supported by libcaptive */
+#endif /* !LIBCAPTIVE */
}
if (ExportAddress == NULL)
return(ExportAddress);
}
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
return ExportAddress;
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName)
return NULL;
}
+#ifndef LIBCAPTIVE
PIMAGE_SECTION_HEADER
STDCALL
return STATUS_PROCEDURE_NOT_FOUND;
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
return(&(blk->handles[handle%HANDLE_BLOCK_ENTRIES]));
}
+#ifndef LIBCAPTIVE
+
NTSTATUS
ObDuplicateObject(PEPROCESS SourceProcess,
PEPROCESS TargetProcess,
}
}
+#endif /* LIBCAPTIVE */
VOID ObCreateHandleTable(PEPROCESS Parent,
BOOLEAN Inherit,
return(STATUS_SUCCESS);
}
-
/**********************************************************************
* NAME EXPORTED
* NtClose
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
ObInsertObject(PVOID Object,
PACCESS_STATE PassedAccessState,
Handle));
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* FUNCTIONS **************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
ULONG Attributes,
return Status;
}
+#endif /* LIBCAPTIVE */
VOID
ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
ObDirectoryType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
- L"Directory");
+ REACTOS_UCS2(L"Directory"));
/* create 'type' object type*/
ObTypeObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
ObTypeObjectType->DuplicationNotify = NULL;
RtlInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
- L"ObjectType");
+ REACTOS_UCS2(L"ObjectType"));
/* create root directory */
ObCreateObject(NULL,
/* create '\ObjectTypes' directory */
RtlInitUnicodeStringFromLiteral(&Name,
- L"\\ObjectTypes");
+ REACTOS_UCS2(L"\\ObjectTypes"));
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_PERMANENT,
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);
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
ObOpenObjectByPointer(IN POBJECT Object,
return STATUS_SUCCESS;
}
+#endif /* LIBCAPTIVE */
static NTSTATUS
ObpPerformRetentionChecks(POBJECT_HEADER Header)
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
/**********************************************************************
* NAME EXPORTED
ObpPerformRetentionChecks(Header);
}
+#endif /* LIBCAPTIVE */
/**********************************************************************
* NAME EXPORTED
ObpPerformRetentionChecks(Header);
}
+#ifndef LIBCAPTIVE
/**********************************************************************
* NAME EXPORTED
return(Header->HandleCount);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
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];
+#endif /* LIBCAPTIVE */
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
PsAssignImpersonationToken(PETHREAD Thread,
HANDLE TokenHandle)
DPRINT("PiDeleteThread() finished\n");
}
+#endif /* LIBCAPTIVE */
+
NTSTATUS
PsInitializeThread(HANDLE ProcessHandle,
PETHREAD* ThreadPtr,
NTSTATUS Status;
KIRQL oldIrql;
PEPROCESS Process;
+#ifndef LIBCAPTIVE
ULONG i;
+#endif /* LIBCAPTIVE */
/*
* Reference process
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);
}
+#endif /* LIBCAPTIVE */
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
static NTSTATUS
PsCreateTeb(HANDLE ProcessHandle,
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
#define MAX_PROCESS_NOTIFY_ROUTINE_COUNT 8
+#ifndef LIBCAPTIVE
static ULONG PiProcessNotifyRoutineCount = 0;
static PCREATE_PROCESS_NOTIFY_ROUTINE
PiProcessNotifyRoutine[MAX_PROCESS_NOTIFY_ROUTINE_COUNT];
+#endif /* LIBCAPTIVE */
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
PEPROCESS
PsGetNextProcess(PEPROCESS OldProcess)
KeReleaseSpinLock(&PsProcessListLock, oldIrql);
}
+#endif /* LIBCAPTIVE */
VOID
PsInitProcessManagment(VOID)
PsProcessType->Dump = NULL;
PsProcessType->Open = NULL;
PsProcessType->Close = NULL;
+#ifndef LIBCAPTIVE
PsProcessType->Delete = PiDeleteProcess;
+#else
+ PsProcessType->Delete = NULL; /* never Delete PsInitialSystemProcess */
+#endif /* LIBCAPTIVE */
PsProcessType->Parse = NULL;
PsProcessType->Security = NULL;
PsProcessType->QueryName = NULL;
PsProcessType->Create = NULL;
PsProcessType->DuplicationNotify = NULL;
- RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName, L"Process");
+ RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName, REACTOS_UCS2(L"Process"));
InitializeListHead(&PsProcessListHead);
KeInitializeSpinLock(&PsProcessListLock);
/* 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);
+#endif /* LIBCAPTIVE */
KProcess = &PsInitialSystemProcess->Pcb;
+#ifndef LIBCAPTIVE
MmInitializeAddressSpace(PsInitialSystemProcess,
&PsInitialSystemProcess->AddressSpace);
+#endif /* LIBCAPTIVE */
ObCreateHandleTable(NULL,FALSE,PsInitialSystemProcess);
+#ifndef LIBCAPTIVE
KProcess->DirectoryTableBase =
(LARGE_INTEGER)(LONGLONG)(ULONG)MmGetPageDirectory();
+#endif /* LIBCAPTIVE */
PsInitialSystemProcess->UniqueProcessId =
InterlockedIncrement(&PiNextProcessUniqueId);
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
strcpy(PsInitialSystemProcess->ImageFileName, "SYSTEM");
+#ifndef LIBCAPTIVE
SepCreateSystemProcessToken(PsInitialSystemProcess);
+#endif /* LIBCAPTIVE */
ObCreateHandle(PsInitialSystemProcess,
PsInitialSystemProcess,
&SystemProcessHandle);
}
+#ifndef LIBCAPTIVE
+
VOID STDCALL
PiDeleteProcess(PVOID ObjectBody)
{
return((HANDLE)PsGetCurrentProcess()->UniqueProcessId);
}
+#endif /* LIBCAPTIVE */
+
/*
* FUNCTION: Returns a pointer to the current process
*/
PEPROCESS STDCALL
PsGetCurrentProcess(VOID)
{
+#ifndef LIBCAPTIVE
if (PsGetCurrentThread() == NULL ||
PsGetCurrentThread()->ThreadsProcess == NULL)
{
+#endif /* LIBCAPTIVE */
return(PsInitialSystemProcess);
+#ifndef LIBCAPTIVE
}
else
{
return(PsGetCurrentThread()->ThreadsProcess);
}
+#endif /* LIBCAPTIVE */
}
+#ifndef LIBCAPTIVE
+
PEPROCESS STDCALL
IoGetCurrentProcess(VOID)
{
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/*
* PURPOSE: List of threads associated with each priority level
*/
-LIST_ENTRY PiThreadListHead;
static LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
static BOOLEAN DoneInitYet = FALSE;
+LIST_ENTRY PiThreadListHead;
+#ifndef LIBCAPTIVE
static PETHREAD IdleThreads[MAXIMUM_PROCESSORS];
+#endif /* LIBCAPTIVE */
ULONG PiNrThreads = 0;
+#ifndef LIBCAPTIVE
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,
/* FUNCTIONS ***************************************************************/
+#ifndef LIBCAPTIVE
+
PKTHREAD STDCALL KeGetCurrentThread(VOID)
{
return(KeGetCurrentKPCR()->CurrentThread);
}
+#endif /* LIBCAPTIVE */
+
PETHREAD STDCALL PsGetCurrentThread(VOID)
{
PKTHREAD CurrentThread = KeGetCurrentKPCR()->CurrentThread;
return(CONTAINING_RECORD(CurrentThread, ETHREAD, Tcb));
}
+#ifndef LIBCAPTIVE
+
HANDLE STDCALL PsGetCurrentThreadId(VOID)
{
return(PsGetCurrentThread()->Cid.UniqueThread);
Id, IdleThread->Cid.UniqueThread);
}
+#endif /* LIBCAPTIVE */
+
VOID
PsInitThreadManagment(VOID)
/*
PETHREAD FirstThread;
ULONG i;
HANDLE FirstThreadHandle;
+#ifndef LIBCAPTIVE
NTSTATUS Status;
+#endif /* LIBCAPTIVE */
KeInitializeSpinLock(&PiThreadListLock);
for (i=0; i < MAXIMUM_PRIORITY; i++)
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->Dump = NULL;
PsThreadType->Open = NULL;
PsThreadType->Close = NULL;
+#ifndef LIBCAPTIVE
PsThreadType->Delete = PiDeleteThread;
+#else /* !LIBCAPTIVE */
+ PsThreadType->Delete = NULL;
+#endif /* !LIBCAPTIVE */
PsThreadType->Parse = NULL;
PsThreadType->Security = NULL;
PsThreadType->QueryName = NULL;
DoneInitYet = TRUE;
+#ifndef LIBCAPTIVE
/*
* Create the reaper thread
*/
DPRINT1("PS: Failed to create reaper thread.\n");
KeBugCheck(0);
}
+#endif /* LIBCAPTIVE */
}
+#ifndef LIBCAPTIVE
+
LONG STDCALL
KeSetBasePriorityThread (PKTHREAD Thread,
LONG Increment)
return(STATUS_INVALID_PARAMETER);
}
+#endif /* LIBCAPTIVE */
+
/* EOF */
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
NTSTATUS STDCALL
MmCopyToCaller(PVOID Dest, PVOID Src, ULONG NumberOfBytes)
{
* RETURNS: Number of equal bytes
*/
{
- int i,total;
+ ULONG i,total;
for (i=0,total=0;i<Length;i++)
{
{
PULONG ptr = (PULONG)Source;
ULONG len = Length / sizeof(ULONG);
- int i;
+ ULONG i;
for (i = 0; i < len; i++)
{
}
#endif
+#endif /* LIBCAPTIVE */
+
VOID
STDCALL
RtlFillMemory (
memset(Destination,Fill,Length);
}
+#ifndef LIBCAPTIVE
VOID
STDCALL
);
}
+#endif /* LIBCAPTIVE */
VOID
STDCALL
}
+#ifndef LIBCAPTIVE
NTSTATUS
RtlpInitNlsSections(ULONG Mod1Start,
*OemCodePage = NlsOemCodePage;
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
RtlUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
STDCALL
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS STDCALL
RtlUpcaseUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS STDCALL
RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
int i;
if (sw == NULL)
{
- sw = L"<NULL>";
+ sw = REACTOS_UCS2(L"<NULL>");
len = 6;
}
else
#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>
tp++;
}
- if (tp - temp >= Length)
+ if ((ULONG)(tp - temp) >= Length)
return STATUS_BUFFER_TOO_SMALL;
sp = String;
return *cs - *ct;
}
+#ifndef LIBCAPTIVE
+
wchar_t *_wcslwr (wchar_t *x)
{
wchar_t *y=x;
return x;
}
+#endif /* LIBCAPTIVE */
wchar_t * wcscat(wchar_t *dest, const wchar_t *src)
{
return NULL;
}
+#ifndef LIBCAPTIVE
int wcscmp(const wchar_t *cs, const wchar_t *ct)
{
return *cs - *ct;
}
+#endif /* LIBCAPTIVE */
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
{
return(str1);
}
+#ifndef LIBCAPTIVE
size_t wcscspn(const wchar_t *str,const wchar_t *reject)
{
return s-str; /* nr of wchars */
}
+#endif /* LIBCAPTIVE */
size_t wcslen(const wchar_t *s)
{
return len;
}
+#ifndef LIBCAPTIVE
wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
{
return dest;
}
+#endif /* LIBCAPTIVE */
wchar_t *wcsrchr(const wchar_t *str, wchar_t ch)
{
return NULL;
}
+#ifndef LIBCAPTIVE
size_t wcsspn(const wchar_t *str,const wchar_t *accept)
{
}
return NULL;
}
+
+#endif /* LIBCAPTIVE */