mirror of
https://github.com/reactos/reactos.git
synced 2024-08-30 23:28:58 +00:00
- Fix definition of RTL_CRITICAL_SECTION_DEBUG.
- Fix all MSVC warnings in kernel32. - Re-enable PCH. - Disable Rtl*CondVar calls, since we can't target Vista *AND* 2003 due to linker problems. We'll need a way to create multiple DLL versions if we're going to attempt this. - Make ASSERTs always valid in kernel32 as long as DBG is set. - Fix Windows-loading hack, it seems there's only two levels of SEH. Eitherways, I think I've found a cleaner way to make it load nicely, so this hack will go away soon. svn path=/trunk/; revision=25633
This commit is contained in:
parent
32a29de195
commit
35c5b063fd
|
@ -119,7 +119,7 @@ FindFirstChangeNotificationW (
|
||||||
NULL,//Buffer,
|
NULL,//Buffer,
|
||||||
0,//BufferLength,
|
0,//BufferLength,
|
||||||
dwNotifyFilter,
|
dwNotifyFilter,
|
||||||
bWatchSubtree);
|
(BOOLEAN)bWatchSubtree);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
@ -200,7 +200,7 @@ ReadDirectoryChangesW(
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
nBufferLength,
|
nBufferLength,
|
||||||
dwNotifyFilter,
|
dwNotifyFilter,
|
||||||
bWatchSubtree
|
(BOOLEAN)bWatchSubtree
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
|
|
@ -781,7 +781,7 @@ GetShortPathNameW (
|
||||||
BOOLEAN spaces;
|
BOOLEAN spaces;
|
||||||
memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
|
memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
|
||||||
ustr_buf[tmplen] = '\0';
|
ustr_buf[tmplen] = '\0';
|
||||||
ustr.Length = tmplen * sizeof(WCHAR);
|
ustr.Length = (USHORT)tmplen * sizeof(WCHAR);
|
||||||
if (RtlIsNameLegalDOS8Dot3(&ustr, NULL, &spaces) && !spaces)
|
if (RtlIsNameLegalDOS8Dot3(&ustr, NULL, &spaces) && !spaces)
|
||||||
{
|
{
|
||||||
sp += tmplen;
|
sp += tmplen;
|
||||||
|
@ -889,7 +889,7 @@ SearchPathA (
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferU.MaximumLength = nBufferLength * sizeof(WCHAR);
|
BufferU.MaximumLength = (USHORT)nBufferLength * sizeof(WCHAR);
|
||||||
BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
||||||
0,
|
0,
|
||||||
BufferU.MaximumLength);
|
BufferU.MaximumLength);
|
||||||
|
@ -899,7 +899,7 @@ SearchPathA (
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer.MaximumLength = nBufferLength;
|
Buffer.MaximumLength = (USHORT)nBufferLength;
|
||||||
Buffer.Buffer = lpBuffer;
|
Buffer.Buffer = lpBuffer;
|
||||||
|
|
||||||
RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,
|
RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,
|
||||||
|
|
|
@ -135,10 +135,10 @@ QueryDosDeviceA(
|
||||||
while (ucchMax)
|
while (ucchMax)
|
||||||
{
|
{
|
||||||
CurrentLength = min (ucchMax, MAXUSHORT / 2);
|
CurrentLength = min (ucchMax, MAXUSHORT / 2);
|
||||||
TargetPathU.MaximumLength = TargetPathU.Length = CurrentLength * sizeof(WCHAR);
|
TargetPathU.MaximumLength = TargetPathU.Length = (USHORT)CurrentLength * sizeof(WCHAR);
|
||||||
|
|
||||||
TargetPathA.Length = 0;
|
TargetPathA.Length = 0;
|
||||||
TargetPathA.MaximumLength = CurrentLength;
|
TargetPathA.MaximumLength = (USHORT)CurrentLength;
|
||||||
|
|
||||||
RtlUnicodeStringToAnsiString (&TargetPathA,
|
RtlUnicodeStringToAnsiString (&TargetPathA,
|
||||||
&TargetPathU,
|
&TargetPathU,
|
||||||
|
|
|
@ -38,16 +38,16 @@ FilenameA2W(LPCSTR NameA, BOOL alloc)
|
||||||
PUNICODE_STRING pstrW;
|
PUNICODE_STRING pstrW;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
|
//ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
|
||||||
ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer));
|
ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer));
|
||||||
|
|
||||||
RtlInitAnsiString(&str, NameA);
|
RtlInitAnsiString(&str, NameA);
|
||||||
pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString;
|
pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString;
|
||||||
|
|
||||||
if (bIsFileApiAnsi)
|
if (bIsFileApiAnsi)
|
||||||
Status= RtlAnsiStringToUnicodeString( pstrW, &str, alloc );
|
Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
|
||||||
else
|
else
|
||||||
Status= RtlOemStringToUnicodeString( pstrW, &str, alloc );
|
Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
return pstrW->Buffer;
|
return pstrW->Buffer;
|
||||||
|
@ -85,7 +85,7 @@ FilenameU2A_FitOrFail(
|
||||||
ANSI_STRING str;
|
ANSI_STRING str;
|
||||||
|
|
||||||
str.Buffer = DestA;
|
str.Buffer = DestA;
|
||||||
str.MaximumLength = destLen;
|
str.MaximumLength = (USHORT)destLen;
|
||||||
|
|
||||||
|
|
||||||
if (bIsFileApiAnsi)
|
if (bIsFileApiAnsi)
|
||||||
|
@ -337,7 +337,7 @@ OpenFile(LPCSTR lpFileName,
|
||||||
0,
|
0,
|
||||||
FileNameString.Buffer);
|
FileNameString.Buffer);
|
||||||
|
|
||||||
lpReOpenBuff->nErrCode = RtlNtStatusToDosError(errCode);
|
lpReOpenBuff->nErrCode = (WORD)RtlNtStatusToDosError(errCode);
|
||||||
|
|
||||||
if (!NT_SUCCESS(errCode))
|
if (!NT_SUCCESS(errCode))
|
||||||
{
|
{
|
||||||
|
@ -1541,7 +1541,7 @@ CheckNameLegalDOS8Dot3W(
|
||||||
if(lpOemName != NULL)
|
if(lpOemName != NULL)
|
||||||
{
|
{
|
||||||
AnsiName.Buffer = lpOemName;
|
AnsiName.Buffer = lpOemName;
|
||||||
AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
|
AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
|
||||||
AnsiName.Length = 0;
|
AnsiName.Length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1583,7 +1583,7 @@ CheckNameLegalDOS8Dot3A(
|
||||||
if(lpOemName != NULL)
|
if(lpOemName != NULL)
|
||||||
{
|
{
|
||||||
AnsiName.Buffer = lpOemName;
|
AnsiName.Buffer = lpOemName;
|
||||||
AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
|
AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
|
||||||
AnsiName.Length = 0;
|
AnsiName.Length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1628,7 +1628,7 @@ GetFinalPathNameByHandleA(IN HANDLE hFile,
|
||||||
cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
|
cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
|
||||||
{
|
{
|
||||||
FilePathU.Length = 0;
|
FilePathU.Length = 0;
|
||||||
FilePathU.MaximumLength = cchFilePath * sizeof(WCHAR);
|
FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR);
|
||||||
FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
FilePathU.MaximumLength);
|
FilePathU.MaximumLength);
|
||||||
|
|
|
@ -95,7 +95,7 @@ InternalCopyFindDataA(LPWIN32_FIND_DATAA lpFindFileData,
|
||||||
lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart;
|
lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart;
|
||||||
lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart;
|
lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart;
|
||||||
|
|
||||||
FileNameU.Length = FileNameU.MaximumLength = lpFileInfo->FileNameLength;
|
FileNameU.Length = FileNameU.MaximumLength = (USHORT)lpFileInfo->FileNameLength;
|
||||||
FileNameU.Buffer = lpFileInfo->FileName;
|
FileNameU.Buffer = lpFileInfo->FileName;
|
||||||
|
|
||||||
FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR);
|
FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR);
|
||||||
|
@ -213,7 +213,7 @@ InternalFindFirstFile (
|
||||||
PWSTR SearchPath;
|
PWSTR SearchPath;
|
||||||
PWCHAR SearchPattern;
|
PWCHAR SearchPattern;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
BOOLEAN bResult;
|
BOOL bResult;
|
||||||
|
|
||||||
DPRINT("FindFirstFileW(lpFileName %S)\n",
|
DPRINT("FindFirstFileW(lpFileName %S)\n",
|
||||||
lpFileName);
|
lpFileName);
|
||||||
|
@ -698,7 +698,7 @@ static VOID
|
||||||
InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
|
InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
|
||||||
OUT LPVOID lpFindStreamData)
|
OUT LPVOID lpFindStreamData)
|
||||||
{
|
{
|
||||||
ASSERT(IData->pCurrent != NULL);
|
ASSERT(IData->pCurrent);
|
||||||
|
|
||||||
switch (IData->InfoLevel)
|
switch (IData->InfoLevel)
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,8 +98,8 @@ LockFileEx(
|
||||||
&Offset,
|
&Offset,
|
||||||
&BytesToLock,
|
&BytesToLock,
|
||||||
0,
|
0,
|
||||||
LockImmediate,
|
(BOOLEAN)LockImmediate,
|
||||||
LockExclusive);
|
(BOOLEAN)LockExclusive);
|
||||||
if ( !NT_SUCCESS(errCode) )
|
if ( !NT_SUCCESS(errCode) )
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus (errCode);
|
SetLastErrorByStatus (errCode);
|
||||||
|
|
|
@ -919,7 +919,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
|
||||||
|
|
||||||
if(lpUserName != NULL)
|
if(lpUserName != NULL)
|
||||||
{
|
{
|
||||||
UserNameW.MaximumLength = nMaxUserNameSize * sizeof(WCHAR);
|
UserNameW.MaximumLength = (USHORT)nMaxUserNameSize * sizeof(WCHAR);
|
||||||
UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength);
|
UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength);
|
||||||
if (UserNameW.Buffer == NULL)
|
if (UserNameW.Buffer == NULL)
|
||||||
{
|
{
|
||||||
|
@ -929,7 +929,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
|
||||||
|
|
||||||
UserNameA.Buffer = lpUserName;
|
UserNameA.Buffer = lpUserName;
|
||||||
UserNameA.Length = 0;
|
UserNameA.Length = 0;
|
||||||
UserNameA.MaximumLength = nMaxUserNameSize;
|
UserNameA.MaximumLength = (USHORT)nMaxUserNameSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ret = GetNamedPipeHandleStateW(hNamedPipe,
|
Ret = GetNamedPipeHandleStateW(hNamedPipe,
|
||||||
|
|
|
@ -106,7 +106,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
|
||||||
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
||||||
if (dwDriveMap & (1<<drive))
|
if (dwDriveMap & (1<<drive))
|
||||||
{
|
{
|
||||||
*p++ = 'A' + drive;
|
*p++ = 'A' + (UCHAR)drive;
|
||||||
*p++ = ':';
|
*p++ = ':';
|
||||||
*p++ = '\\';
|
*p++ = '\\';
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
@ -464,7 +464,7 @@ GetVolumeInformationA(
|
||||||
|
|
||||||
if (lpVolumeNameBuffer)
|
if (lpVolumeNameBuffer)
|
||||||
{
|
{
|
||||||
VolumeNameU.MaximumLength = nVolumeNameSize * sizeof(WCHAR);
|
VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR);
|
||||||
VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
||||||
0,
|
0,
|
||||||
VolumeNameU.MaximumLength);
|
VolumeNameU.MaximumLength);
|
||||||
|
@ -477,7 +477,7 @@ GetVolumeInformationA(
|
||||||
if (lpFileSystemNameBuffer)
|
if (lpFileSystemNameBuffer)
|
||||||
{
|
{
|
||||||
FileSystemNameU.Length = 0;
|
FileSystemNameU.Length = 0;
|
||||||
FileSystemNameU.MaximumLength = nFileSystemNameSize * sizeof(WCHAR);
|
FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR);
|
||||||
FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
||||||
0,
|
0,
|
||||||
FileSystemNameU.MaximumLength);
|
FileSystemNameU.MaximumLength);
|
||||||
|
@ -511,7 +511,7 @@ FailNoMem:
|
||||||
{
|
{
|
||||||
VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
|
VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
|
||||||
VolumeName.Length = 0;
|
VolumeName.Length = 0;
|
||||||
VolumeName.MaximumLength = nVolumeNameSize;
|
VolumeName.MaximumLength = (USHORT)nVolumeNameSize;
|
||||||
VolumeName.Buffer = lpVolumeNameBuffer;
|
VolumeName.Buffer = lpVolumeNameBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ FailNoMem:
|
||||||
{
|
{
|
||||||
FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
|
FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
|
||||||
FileSystemName.Length = 0;
|
FileSystemName.Length = 0;
|
||||||
FileSystemName.MaximumLength = nFileSystemNameSize;
|
FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize;
|
||||||
FileSystemName.Buffer = lpFileSystemNameBuffer;
|
FileSystemName.Buffer = lpFileSystemNameBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,15 @@
|
||||||
#define DPRINT
|
#define DPRINT
|
||||||
#endif
|
#endif
|
||||||
#define CHECKPOINT
|
#define CHECKPOINT
|
||||||
#ifdef ASSERT
|
|
||||||
#undef ASSERT
|
|
||||||
#endif
|
|
||||||
#define ASSERT(x)
|
|
||||||
#else
|
#else
|
||||||
#define DPRINT(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
|
#define DPRINT(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
|
||||||
#define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
|
#define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
|
||||||
#ifdef ASSERT
|
|
||||||
#undef ASSERT
|
|
||||||
#endif
|
|
||||||
#define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ASSERT
|
||||||
|
#undef ASSERT
|
||||||
|
#define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
|
||||||
|
#endif
|
||||||
#define DPRINT1(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
|
#define DPRINT1(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
|
||||||
#define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
|
#define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
|
||||||
|
|
||||||
|
|
|
@ -105,11 +105,11 @@ BasepInitializeContext(IN PCONTEXT Context,
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
BaseThreadStartupThunk();
|
BaseThreadStartupThunk(VOID);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
BaseProcessStartThunk();
|
BaseProcessStartThunk(VOID);
|
||||||
|
|
||||||
__declspec(noreturn)
|
__declspec(noreturn)
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
/* PSDK/NDK Headers */
|
/* PSDK/NDK Headers */
|
||||||
|
#define DBG 1
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#define _KERNEL32_
|
#define _KERNEL32_
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
/* DDK Driver Headers */
|
/* DDK Driver Headers */
|
||||||
#include <ntddbeep.h>
|
#include <ntddbeep.h>
|
||||||
#include <ntddser.h>
|
|
||||||
#include <mountmgr.h>
|
#include <mountmgr.h>
|
||||||
#include <mountdev.h>
|
#include <mountdev.h>
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,10 @@
|
||||||
<define name="_DISABLE_TIDENTS" />
|
<define name="_DISABLE_TIDENTS" />
|
||||||
<define name="_SEH_NO_NATIVE_NLG" />
|
<define name="_SEH_NO_NATIVE_NLG" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="_WIN32_WINNT">0x0502</define>
|
<define name="_WIN32_WINNT">0x0600</define>
|
||||||
<define name="__NO_CTYPE_INLINES" />
|
<define name="__NO_CTYPE_INLINES" />
|
||||||
<define name="WINVER">0x502</define>
|
<define name="WINVER">0x609</define>
|
||||||
<!--
|
|
||||||
!!! DO NOT ENABLE PCH! SOME FILES ARE NOT PCH-SAFE AS THEY DEFINE !!!
|
|
||||||
!!! _WIN32_WINNT DIFFERENTLY BEFORE INCLUDING k32.h !!!
|
|
||||||
|
|
||||||
<pch>k32.h</pch>
|
<pch>k32.h</pch>
|
||||||
-->
|
|
||||||
<directory name="debug">
|
<directory name="debug">
|
||||||
<file>debugger.c</file>
|
<file>debugger.c</file>
|
||||||
<file>output.c</file>
|
<file>output.c</file>
|
||||||
|
|
|
@ -914,12 +914,12 @@ GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
||||||
/* Reset the right size and fill out the information */
|
/* Reset the right size and fill out the information */
|
||||||
lpBuffer->dwLength = sizeof(MEMORYSTATUS);
|
lpBuffer->dwLength = sizeof(MEMORYSTATUS);
|
||||||
lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
|
lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
|
||||||
lpBuffer->dwTotalPhys = lpBufferEx.ullTotalPhys;
|
lpBuffer->dwTotalPhys = (SIZE_T)lpBufferEx.ullTotalPhys;
|
||||||
lpBuffer->dwAvailPhys = lpBufferEx.ullAvailPhys;
|
lpBuffer->dwAvailPhys = (SIZE_T)lpBufferEx.ullAvailPhys;
|
||||||
lpBuffer->dwTotalPageFile = lpBufferEx.ullTotalPageFile;
|
lpBuffer->dwTotalPageFile = (SIZE_T)lpBufferEx.ullTotalPageFile;
|
||||||
lpBuffer->dwAvailPageFile = lpBufferEx.ullAvailPageFile;
|
lpBuffer->dwAvailPageFile = (SIZE_T)lpBufferEx.ullAvailPageFile;
|
||||||
lpBuffer->dwTotalVirtual = lpBufferEx.ullTotalVirtual;
|
lpBuffer->dwTotalVirtual = (SIZE_T)lpBufferEx.ullTotalVirtual;
|
||||||
lpBuffer->dwAvailVirtual = lpBufferEx.ullAvailVirtual;
|
lpBuffer->dwAvailVirtual = (SIZE_T)lpBufferEx.ullAvailVirtual;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,8 +157,8 @@ HeapExtend(HANDLE hHeap,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* Call the RTL API */
|
/* Call the RTL API. Gone in Vista, so commented out. */
|
||||||
Status = RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
|
Status = STATUS_NOT_IMPLEMENTED; //RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* We failed */
|
/* We failed */
|
||||||
|
@ -185,7 +185,7 @@ HeapQueryTagW(HANDLE hHeap,
|
||||||
return RtlQueryTagHeap(hHeap,
|
return RtlQueryTagHeap(hHeap,
|
||||||
dwFlags,
|
dwFlags,
|
||||||
wTagIndex,
|
wTagIndex,
|
||||||
bResetCounters,
|
(BOOLEAN)bResetCounters,
|
||||||
lpTagInfo);
|
lpTagInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,8 +204,8 @@ HeapSummary(HANDLE hHeap,
|
||||||
/* Fill in the length information */
|
/* Fill in the length information */
|
||||||
Usage.Length = sizeof(Usage);
|
Usage.Length = sizeof(Usage);
|
||||||
|
|
||||||
/* Call RTL */
|
/* Call RTL. Gone in Vista, so commented out */
|
||||||
Status = RtlUsageHeap(hHeap, dwFlags, &Usage);
|
Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* We failed */
|
/* We failed */
|
||||||
|
@ -231,8 +231,8 @@ HeapUsage(HANDLE hHeap,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* Call RTL */
|
/* Call RTL. Gone in Vista, so commented out */
|
||||||
Status = RtlUsageHeap(hHeap, dwFlags, Usage);
|
Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* We failed */
|
/* We failed */
|
||||||
|
|
|
@ -40,10 +40,10 @@ FindActCtxSectionStringA(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call the Unicode function */
|
/* Call the Unicode function */
|
||||||
bRetVal = FindActCtxSectionStringA(dwFlags,
|
bRetVal = FindActCtxSectionStringW(dwFlags,
|
||||||
lpExtensionGuid,
|
lpExtensionGuid,
|
||||||
ulSectionId,
|
ulSectionId,
|
||||||
lpStringToFind,
|
lpStringToFindW,
|
||||||
ReturnedData);
|
ReturnedData);
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
|
|
|
@ -21,6 +21,24 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <k32.h>
|
#include <k32.h>
|
||||||
|
#undef SERIAL_LSRMST_ESCAPE
|
||||||
|
#undef SERIAL_LSRMST_LSR_DATA
|
||||||
|
#undef SERIAL_LSRMST_LSR_NODATA
|
||||||
|
#undef SERIAL_LSRMST_MST
|
||||||
|
#undef SERIAL_IOC_FCR_FIFO_ENABLE
|
||||||
|
#undef SERIAL_IOC_FCR_RCVR_RESET
|
||||||
|
#undef SERIAL_IOC_FCR_XMIT_RESET
|
||||||
|
#undef SERIAL_IOC_FCR_DMA_MODE
|
||||||
|
#undef SERIAL_IOC_FCR_RES1
|
||||||
|
#undef SERIAL_IOC_FCR_RES2
|
||||||
|
#undef SERIAL_IOC_FCR_RCVR_TRIGGER_LSB
|
||||||
|
#undef SERIAL_IOC_FCR_RCVR_TRIGGER_MSB
|
||||||
|
#undef SERIAL_IOC_MCR_DTR
|
||||||
|
#undef SERIAL_IOC_MCR_RTS
|
||||||
|
#undef SERIAL_IOC_MCR_OUT1
|
||||||
|
#undef SERIAL_IOC_MCR_OUT2
|
||||||
|
#undef SERIAL_IOC_MCR_LOOP
|
||||||
|
#include <ntddser.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "../include/debug.h"
|
#include "../include/debug.h"
|
||||||
|
@ -331,7 +349,7 @@ COMMDCB_PARAM_HANDLER(data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
Dcb->ByteSize = nValue;
|
Dcb->ByteSize = (BYTE)nValue;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +460,7 @@ COMMDCB_PARAM_HANDLER(parity)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
Dcb->Parity = nValue;
|
Dcb->Parity = (BYTE)nValue;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,7 +521,7 @@ COMMDCB_PARAM_HANDLER(stop)
|
||||||
*StopBitsSet = TRUE;
|
*StopBitsSet = TRUE;
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
Dcb->StopBits = nValue;
|
Dcb->StopBits = (BYTE)nValue;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1112,8 +1130,8 @@ GetCommState(HANDLE hFile, LPDCB lpDCB)
|
||||||
if (HandFlow.FlowReplace & SERIAL_XOFF_CONTINUE) {
|
if (HandFlow.FlowReplace & SERIAL_XOFF_CONTINUE) {
|
||||||
lpDCB->fTXContinueOnXoff = 1;
|
lpDCB->fTXContinueOnXoff = 1;
|
||||||
}
|
}
|
||||||
lpDCB->XonLim = HandFlow.XonLimit;
|
lpDCB->XonLim = (WORD)HandFlow.XonLimit;
|
||||||
lpDCB->XoffLim = HandFlow.XoffLimit;
|
lpDCB->XoffLim = (WORD)HandFlow.XoffLimit;
|
||||||
|
|
||||||
result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
|
result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
|
||||||
NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL);
|
NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL);
|
||||||
|
|
|
@ -144,7 +144,7 @@ GetComputerNameExW (
|
||||||
|
|
||||||
case ComputerNameDnsFullyQualified:
|
case ComputerNameDnsFullyQualified:
|
||||||
ResultString.Length = 0;
|
ResultString.Length = 0;
|
||||||
ResultString.MaximumLength = *nSize * sizeof(WCHAR);
|
ResultString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
|
||||||
ResultString.Buffer = lpBuffer;
|
ResultString.Buffer = lpBuffer;
|
||||||
|
|
||||||
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
||||||
|
@ -238,15 +238,15 @@ GetComputerNameExA (
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnsiString.MaximumLength = *nSize;
|
AnsiString.MaximumLength = (USHORT)*nSize;
|
||||||
AnsiString.Length = 0;
|
AnsiString.Length = 0;
|
||||||
AnsiString.Buffer = lpBuffer;
|
AnsiString.Buffer = lpBuffer;
|
||||||
|
|
||||||
Result = GetComputerNameExW( NameType, TempBuffer, nSize );
|
Result = GetComputerNameExW( NameType, TempBuffer, nSize );
|
||||||
|
|
||||||
if( Result ) {
|
if( Result ) {
|
||||||
UnicodeString.MaximumLength = *nSize * sizeof(WCHAR);
|
UnicodeString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
|
||||||
UnicodeString.Length = *nSize * sizeof(WCHAR);
|
UnicodeString.Length = (USHORT)*nSize * sizeof(WCHAR);
|
||||||
UnicodeString.Buffer = TempBuffer;
|
UnicodeString.Buffer = TempBuffer;
|
||||||
|
|
||||||
RtlUnicodeStringToAnsiString (&AnsiString,
|
RtlUnicodeStringToAnsiString (&AnsiString,
|
||||||
|
|
|
@ -483,7 +483,7 @@ GetConsoleCommandHistoryLengthA (DWORD Unknown0)
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
DWORD STDCALL
|
INT STDCALL
|
||||||
GetConsoleDisplayMode (LPDWORD lpdwMode)
|
GetConsoleDisplayMode (LPDWORD lpdwMode)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Get the console display mode
|
* FUNCTION: Get the console display mode
|
||||||
|
@ -592,7 +592,7 @@ GetConsoleInputWaitHandle (VOID)
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
DWORD STDCALL
|
INT STDCALL
|
||||||
GetCurrentConsoleFont(HANDLE hConsoleOutput,
|
GetCurrentConsoleFont(HANDLE hConsoleOutput,
|
||||||
BOOL bMaximumWindow,
|
BOOL bMaximumWindow,
|
||||||
PCONSOLE_FONT_INFO lpConsoleCurrentFont)
|
PCONSOLE_FONT_INFO lpConsoleCurrentFont)
|
||||||
|
@ -1126,7 +1126,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
||||||
Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput;
|
Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput;
|
||||||
Request->Data.WriteConsoleRequest.Unicode = bUnicode;
|
Request->Data.WriteConsoleRequest.Unicode = bUnicode;
|
||||||
|
|
||||||
nChars = min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
||||||
Request->Data.WriteConsoleRequest.NrCharactersToWrite = nChars;
|
Request->Data.WriteConsoleRequest.NrCharactersToWrite = nChars;
|
||||||
|
|
||||||
SizeBytes = nChars * CharSize;
|
SizeBytes = nChars * CharSize;
|
||||||
|
@ -1245,8 +1245,8 @@ IntReadConsole(HANDLE hConsoleInput,
|
||||||
|
|
||||||
Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput;
|
Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput;
|
||||||
Request->Data.ReadConsoleRequest.Unicode = bUnicode;
|
Request->Data.ReadConsoleRequest.Unicode = bUnicode;
|
||||||
Request->Data.ReadConsoleRequest.NrCharactersToRead = min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
|
Request->Data.ReadConsoleRequest.NrCharactersToRead = (WORD)min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
|
||||||
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = CharsRead;
|
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = (WORD)CharsRead;
|
||||||
Status = CsrClientCallServer(Request,
|
Status = CsrClientCallServer(Request,
|
||||||
NULL,
|
NULL,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
|
@ -1477,7 +1477,7 @@ IntFillConsoleOutputCharacter(HANDLE hConsoleOutput,
|
||||||
else
|
else
|
||||||
Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter);
|
Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter);
|
||||||
Request.Data.FillOutputRequest.Position = dwWriteCoord;
|
Request.Data.FillOutputRequest.Position = dwWriteCoord;
|
||||||
Request.Data.FillOutputRequest.Length = nLength;
|
Request.Data.FillOutputRequest.Length = (WORD)nLength;
|
||||||
Status = CsrClientCallServer(&Request, NULL,
|
Status = CsrClientCallServer(&Request, NULL,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
sizeof(CSR_API_MESSAGE));
|
sizeof(CSR_API_MESSAGE));
|
||||||
|
@ -2316,7 +2316,7 @@ IntWriteConsoleOutputCharacter(HANDLE hConsoleOutput,
|
||||||
|
|
||||||
Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
|
Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
|
||||||
Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode;
|
Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode;
|
||||||
Request->Data.WriteConsoleOutputCharRequest.Length = min(nLength, nChars);
|
Request->Data.WriteConsoleOutputCharRequest.Length = (WORD)min(nLength, nChars);
|
||||||
BytesWrite = Request->Data.WriteConsoleOutputCharRequest.Length * CharSize;
|
BytesWrite = Request->Data.WriteConsoleOutputCharRequest.Length * CharSize;
|
||||||
|
|
||||||
memcpy(Request->Data.WriteConsoleOutputCharRequest.String, lpCharacter, BytesWrite);
|
memcpy(Request->Data.WriteConsoleOutputCharRequest.String, lpCharacter, BytesWrite);
|
||||||
|
@ -2430,7 +2430,7 @@ WriteConsoleOutputAttribute(
|
||||||
*lpNumberOfAttrsWritten = nLength;
|
*lpNumberOfAttrsWritten = nLength;
|
||||||
while( nLength )
|
while( nLength )
|
||||||
{
|
{
|
||||||
Size = min(nLength, CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD));
|
Size = (WORD)min(nLength, CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD));
|
||||||
Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput;
|
Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput;
|
||||||
Request->Data.WriteConsoleOutputAttribRequest.Length = Size;
|
Request->Data.WriteConsoleOutputAttribRequest.Length = Size;
|
||||||
memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
|
memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
|
||||||
|
@ -2479,9 +2479,9 @@ FillConsoleOutputAttribute(
|
||||||
|
|
||||||
CsrRequest = MAKE_CSR_API(FILL_OUTPUT_ATTRIB, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(FILL_OUTPUT_ATTRIB, CSR_CONSOLE);
|
||||||
Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput;
|
Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput;
|
||||||
Request.Data.FillOutputAttribRequest.Attribute = wAttribute;
|
Request.Data.FillOutputAttribRequest.Attribute = (CHAR)wAttribute;
|
||||||
Request.Data.FillOutputAttribRequest.Coord = dwWriteCoord;
|
Request.Data.FillOutputAttribRequest.Coord = dwWriteCoord;
|
||||||
Request.Data.FillOutputAttribRequest.Length = nLength;
|
Request.Data.FillOutputAttribRequest.Length = (WORD)nLength;
|
||||||
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
||||||
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
|
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
|
||||||
{
|
{
|
||||||
|
@ -2891,7 +2891,7 @@ SetConsoleTextAttribute(
|
||||||
|
|
||||||
CsrRequest = MAKE_CSR_API(SET_ATTRIB, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(SET_ATTRIB, CSR_CONSOLE);
|
||||||
Request.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput;
|
Request.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput;
|
||||||
Request.Data.SetAttribRequest.Attrib = wAttributes;
|
Request.Data.SetAttribRequest.Attrib = (CHAR)wAttributes;
|
||||||
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
||||||
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
|
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
|
||||||
{
|
{
|
||||||
|
@ -2975,7 +2975,7 @@ BOOL WINAPI
|
||||||
SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
|
SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
|
||||||
BOOL Add)
|
BOOL Add)
|
||||||
{
|
{
|
||||||
BOOLEAN Ret;
|
BOOL Ret;
|
||||||
|
|
||||||
RtlEnterCriticalSection(&DllLock);
|
RtlEnterCriticalSection(&DllLock);
|
||||||
if (Add)
|
if (Add)
|
||||||
|
@ -3652,7 +3652,7 @@ GetConsoleInputExeNameA(DWORD nBufferLength, LPSTR lpBuffer)
|
||||||
RtlInitUnicodeString(&BufferU, Buffer);
|
RtlInitUnicodeString(&BufferU, Buffer);
|
||||||
|
|
||||||
BufferA.Length = 0;
|
BufferA.Length = 0;
|
||||||
BufferA.MaximumLength = nBufferLength;
|
BufferA.MaximumLength = (USHORT)nBufferLength;
|
||||||
BufferA.Buffer = lpBuffer;
|
BufferA.Buffer = lpBuffer;
|
||||||
|
|
||||||
RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);
|
RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);
|
||||||
|
|
|
@ -323,7 +323,7 @@ DllMain(HANDLE hDll,
|
||||||
if (hDll == (HANDLE)0x7c800000)
|
if (hDll == (HANDLE)0x7c800000)
|
||||||
{
|
{
|
||||||
PULONG Eip;
|
PULONG Eip;
|
||||||
Eip = (PULONG)*(PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
|
Eip = (PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
|
||||||
0x9 +
|
0x9 +
|
||||||
FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
|
FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
|
||||||
*Eip = (ULONG)BaseProcessStartThunk;
|
*Eip = (ULONG)BaseProcessStartThunk;
|
||||||
|
|
|
@ -43,14 +43,14 @@ GetEnvironmentVariableA (
|
||||||
|
|
||||||
/* initialize ansi variable value string */
|
/* initialize ansi variable value string */
|
||||||
VarValue.Length = 0;
|
VarValue.Length = 0;
|
||||||
VarValue.MaximumLength = nSize;
|
VarValue.MaximumLength = (USHORT)nSize;
|
||||||
VarValue.Buffer = lpBuffer;
|
VarValue.Buffer = lpBuffer;
|
||||||
|
|
||||||
/* initialize unicode variable value string and allocate buffer */
|
/* initialize unicode variable value string and allocate buffer */
|
||||||
VarValueU.Length = 0;
|
VarValueU.Length = 0;
|
||||||
if (nSize != 0)
|
if (nSize != 0)
|
||||||
{
|
{
|
||||||
VarValueU.MaximumLength = (nSize - 1) * sizeof(WCHAR);
|
VarValueU.MaximumLength = (USHORT)(nSize - 1) * sizeof(WCHAR);
|
||||||
VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
||||||
0,
|
0,
|
||||||
nSize * sizeof(WCHAR));
|
nSize * sizeof(WCHAR));
|
||||||
|
@ -139,7 +139,7 @@ GetEnvironmentVariableW (
|
||||||
lpName);
|
lpName);
|
||||||
|
|
||||||
VarValue.Length = 0;
|
VarValue.Length = 0;
|
||||||
VarValue.MaximumLength = (nSize != 0 ? (nSize - 1) * sizeof(WCHAR) : 0);
|
VarValue.MaximumLength = (USHORT)(nSize != 0 ? (nSize - 1) * sizeof(WCHAR) : 0);
|
||||||
VarValue.Buffer = lpBuffer;
|
VarValue.Buffer = lpBuffer;
|
||||||
|
|
||||||
Status = RtlQueryEnvironmentVariable_U (NULL,
|
Status = RtlQueryEnvironmentVariable_U (NULL,
|
||||||
|
@ -298,10 +298,10 @@ GetEnvironmentStringsA (
|
||||||
DPRINT("EnvPtr %p\n", EnvPtr);
|
DPRINT("EnvPtr %p\n", EnvPtr);
|
||||||
|
|
||||||
/* convert unicode environment to ansi */
|
/* convert unicode environment to ansi */
|
||||||
UnicodeString.MaximumLength = Length * sizeof(WCHAR) + sizeof(WCHAR);
|
UnicodeString.MaximumLength = (USHORT)Length * sizeof(WCHAR) + sizeof(WCHAR);
|
||||||
UnicodeString.Buffer = EnvU;
|
UnicodeString.Buffer = EnvU;
|
||||||
|
|
||||||
AnsiString.MaximumLength = Length + 1;
|
AnsiString.MaximumLength = (USHORT)Length + 1;
|
||||||
AnsiString.Length = 0;
|
AnsiString.Length = 0;
|
||||||
AnsiString.Buffer = EnvPtr;
|
AnsiString.Buffer = EnvPtr;
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ GetEnvironmentStringsA (
|
||||||
if (UnicodeString.Length > 0)
|
if (UnicodeString.Length > 0)
|
||||||
{
|
{
|
||||||
AnsiString.Length = 0;
|
AnsiString.Length = 0;
|
||||||
AnsiString.MaximumLength = Length + 1 - (AnsiString.Buffer - EnvPtr);
|
AnsiString.MaximumLength = (USHORT)Length + 1 - (AnsiString.Buffer - EnvPtr);
|
||||||
|
|
||||||
RtlUnicodeStringToAnsiString (&AnsiString,
|
RtlUnicodeStringToAnsiString (&AnsiString,
|
||||||
&UnicodeString,
|
&UnicodeString,
|
||||||
|
@ -407,11 +407,11 @@ ExpandEnvironmentStringsA (
|
||||||
}
|
}
|
||||||
|
|
||||||
Destination.Length = 0;
|
Destination.Length = 0;
|
||||||
Destination.MaximumLength = nSize;
|
Destination.MaximumLength = (USHORT)nSize;
|
||||||
Destination.Buffer = lpDst;
|
Destination.Buffer = lpDst;
|
||||||
|
|
||||||
DestinationU.Length = 0;
|
DestinationU.Length = 0;
|
||||||
DestinationU.MaximumLength = nSize * sizeof(WCHAR);
|
DestinationU.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
|
||||||
DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
|
||||||
0,
|
0,
|
||||||
DestinationU.MaximumLength);
|
DestinationU.MaximumLength);
|
||||||
|
@ -473,7 +473,7 @@ ExpandEnvironmentStringsW (
|
||||||
(LPWSTR)lpSrc);
|
(LPWSTR)lpSrc);
|
||||||
|
|
||||||
Destination.Length = 0;
|
Destination.Length = 0;
|
||||||
Destination.MaximumLength = nSize * sizeof(WCHAR);
|
Destination.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
|
||||||
Destination.Buffer = lpDst;
|
Destination.Buffer = lpDst;
|
||||||
|
|
||||||
Status = RtlExpandEnvironmentStrings_U (NULL,
|
Status = RtlExpandEnvironmentStrings_U (NULL,
|
||||||
|
|
|
@ -104,7 +104,7 @@ static LPSTR load_messageA( HMODULE module, UINT id, WORD lang )
|
||||||
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
|
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
|
||||||
memcpy( buffer, mre->Text, len );
|
memcpy( buffer, mre->Text, len );
|
||||||
}
|
}
|
||||||
TRACE("returning %s\n", wine_dbgstr_a(buffer));
|
//TRACE("returning %s\n", wine_dbgstr_a(buffer));
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ static LPWSTR load_messageW( HMODULE module, UINT id, WORD lang )
|
||||||
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
|
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
|
||||||
MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len );
|
MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len );
|
||||||
}
|
}
|
||||||
TRACE("returning %s\n", wine_dbgstr_w(buffer));
|
//TRACE("returning %s\n", wine_dbgstr_w(buffer));
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,9 +187,9 @@ DWORD WINAPI FormatMessageA(
|
||||||
else {
|
else {
|
||||||
from = NULL;
|
from = NULL;
|
||||||
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
|
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
|
||||||
from = load_messageA( (HMODULE)lpSource, dwMessageId, dwLanguageId );
|
from = load_messageA( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId );
|
||||||
if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
|
if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
|
||||||
from = load_messageA( kernel32_handle, dwMessageId, dwLanguageId );
|
from = load_messageA( kernel32_handle, dwMessageId, (WORD)dwLanguageId );
|
||||||
|
|
||||||
if (!from)
|
if (!from)
|
||||||
{
|
{
|
||||||
|
@ -373,7 +373,7 @@ DWORD WINAPI FormatMessageA(
|
||||||
if (nSize && talloced<nSize) {
|
if (nSize && talloced<nSize) {
|
||||||
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
|
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
|
||||||
}
|
}
|
||||||
TRACE("-- %s\n",debugstr_a(target));
|
//TRACE("-- %s\n",debugstr_a(target));
|
||||||
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
|
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
|
||||||
*((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced));
|
*((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced));
|
||||||
memcpy(*(LPSTR*)lpBuffer,target,talloced);
|
memcpy(*(LPSTR*)lpBuffer,target,talloced);
|
||||||
|
@ -439,9 +439,9 @@ DWORD WINAPI FormatMessageW(
|
||||||
else {
|
else {
|
||||||
from = NULL;
|
from = NULL;
|
||||||
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
|
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
|
||||||
from = load_messageW( (HMODULE)lpSource, dwMessageId, dwLanguageId );
|
from = load_messageW( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId );
|
||||||
if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
|
if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
|
||||||
from = load_messageW( kernel32_handle, dwMessageId, dwLanguageId );
|
from = load_messageW( kernel32_handle, dwMessageId,(WORD)dwLanguageId );
|
||||||
|
|
||||||
if (!from)
|
if (!from)
|
||||||
{
|
{
|
||||||
|
@ -636,8 +636,8 @@ DWORD WINAPI FormatMessageW(
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(),0,target);
|
HeapFree(GetProcessHeap(),0,target);
|
||||||
HeapFree(GetProcessHeap(),0,from);
|
HeapFree(GetProcessHeap(),0,from);
|
||||||
TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
|
//TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
|
||||||
*(LPWSTR*)lpBuffer : lpBuffer));
|
// *(LPWSTR*)lpBuffer : lpBuffer));
|
||||||
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
|
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
|
||||||
strlenW(*(LPWSTR*)lpBuffer):
|
strlenW(*(LPWSTR*)lpBuffer):
|
||||||
strlenW(lpBuffer);
|
strlenW(lpBuffer);
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
/* FIXME: these are included in winnls.h, however including this file causes alot of
|
/* FIXME: these are included in winnls.h, however including this file causes alot of
|
||||||
conflicting type errors. */
|
conflicting type errors. */
|
||||||
|
|
||||||
#define LOCALE_SYEARMONTH 0x1006
|
|
||||||
#define LOCALE_IPAPERSIZE 0x100A
|
|
||||||
#define LOCALE_RETURN_NUMBER 0x20000000
|
#define LOCALE_RETURN_NUMBER 0x20000000
|
||||||
#define LOCALE_USE_CP_ACP 0x40000000
|
#define LOCALE_USE_CP_ACP 0x40000000
|
||||||
#define LOCALE_LOCALEINFOFLAGSMASK (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP|LOCALE_RETURN_NUMBER)
|
#define LOCALE_LOCALEINFOFLAGSMASK (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP|LOCALE_RETURN_NUMBER)
|
||||||
|
@ -994,7 +992,7 @@ CompareStringW (
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Result = RtlCompareUnicodeString(
|
Result = RtlCompareUnicodeString(
|
||||||
&String1, &String2, dwCmpFlags & NORM_IGNORECASE);
|
&String1, &String2, (BOOLEAN)(dwCmpFlags & NORM_IGNORECASE));
|
||||||
|
|
||||||
|
|
||||||
if (Result) /* need to translate result */
|
if (Result) /* need to translate result */
|
||||||
|
|
|
@ -85,7 +85,7 @@ static RTL_CRITICAL_SECTION_DEBUG NLS_FormatsCS_debug =
|
||||||
0, 0, &NLS_FormatsCS,
|
0, 0, &NLS_FormatsCS,
|
||||||
{ &NLS_FormatsCS_debug.ProcessLocksList,
|
{ &NLS_FormatsCS_debug.ProcessLocksList,
|
||||||
&NLS_FormatsCS_debug.ProcessLocksList },
|
&NLS_FormatsCS_debug.ProcessLocksList },
|
||||||
0, 0, { 0, (DWORD)(__FILE__ ": NLS_Formats") }
|
0, 0, 0, 0
|
||||||
};
|
};
|
||||||
static RTL_CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };
|
static RTL_CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ GetModuleFileNameA (
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FileName.Length = 0;
|
FileName.Length = 0;
|
||||||
FileName.MaximumLength = nSize * sizeof(WCHAR);
|
FileName.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
|
||||||
FileName.Buffer = lpFilename;
|
FileName.Buffer = lpFilename;
|
||||||
|
|
||||||
/* convert unicode string to ansi (or oem) */
|
/* convert unicode string to ansi (or oem) */
|
||||||
|
@ -383,7 +383,7 @@ GetModuleFileNameW (
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FileName.Length = 0;
|
FileName.Length = 0;
|
||||||
FileName.MaximumLength = nSize * sizeof(WCHAR);
|
FileName.MaximumLength =(USHORT)nSize * sizeof(WCHAR);
|
||||||
FileName.Buffer = lpFilename;
|
FileName.Buffer = lpFilename;
|
||||||
|
|
||||||
RtlCopyUnicodeString (&FileName,
|
RtlCopyUnicodeString (&FileName,
|
||||||
|
@ -680,7 +680,8 @@ LoadModule (
|
||||||
HeapFree(GetProcessHeap(), 0, CommandLine);
|
HeapFree(GetProcessHeap(), 0, CommandLine);
|
||||||
|
|
||||||
/* Wait up to 15 seconds for the process to become idle */
|
/* Wait up to 15 seconds for the process to become idle */
|
||||||
WaitForInputIdle(ProcessInformation.hProcess, 15000);
|
/* FIXME: This is user32! Windows soft-loads this only if required. */
|
||||||
|
//WaitForInputIdle(ProcessInformation.hProcess, 15000);
|
||||||
|
|
||||||
CloseHandle(ProcessInformation.hThread);
|
CloseHandle(ProcessInformation.hThread);
|
||||||
CloseHandle(ProcessInformation.hProcess);
|
CloseHandle(ProcessInformation.hProcess);
|
||||||
|
|
|
@ -266,9 +266,9 @@ INT WINAPI GetExpandedNameA( LPSTR in, LPSTR out )
|
||||||
}
|
}
|
||||||
if (isalpha(head.lastchar)) {
|
if (isalpha(head.lastchar)) {
|
||||||
if (fnislowercased)
|
if (fnislowercased)
|
||||||
head.lastchar=tolower(head.lastchar);
|
head.lastchar=(CHAR)tolower(head.lastchar);
|
||||||
else
|
else
|
||||||
head.lastchar=toupper(head.lastchar);
|
head.lastchar=(CHAR)toupper(head.lastchar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now look where to replace the last character */
|
/* now look where to replace the last character */
|
||||||
|
|
|
@ -489,7 +489,7 @@ IntWideCharToMultiByteUTF8(UINT CodePage, DWORD Flags,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TempLength--;
|
TempLength--;
|
||||||
*MultiByteString++ = Char;
|
*MultiByteString++ = (CHAR)Char;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
|
||||||
{
|
{
|
||||||
0, 0, &PROFILE_CritSect,
|
0, 0, &PROFILE_CritSect,
|
||||||
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
||||||
0, 0, { 0, (DWORD)(__FILE__ ": PROFILE_CritSect") }
|
0, 0, 0, 0
|
||||||
};
|
};
|
||||||
static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
|
static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
|
||||||
}
|
}
|
||||||
|
|
||||||
lstrcpynW( buffer, value, len );
|
lstrcpynW( buffer, value, len );
|
||||||
if (quote && (len >= wcslen(value))) buffer[wcslen(buffer)-1] = '\0';
|
if (quote && (len >= (int)wcslen(value))) buffer[wcslen(buffer)-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
AnsiEnv.Length = (ULONG_PTR)pcScan - (ULONG_PTR)lpEnvironment + sizeof(CHAR);
|
AnsiEnv.Length = (USHORT)((ULONG_PTR)pcScan - (ULONG_PTR)lpEnvironment + sizeof(CHAR));
|
||||||
}
|
}
|
||||||
AnsiEnv.MaximumLength = AnsiEnv.Length + 1;
|
AnsiEnv.MaximumLength = AnsiEnv.Length + 1;
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use the allocated size */
|
/* Use the allocated size */
|
||||||
UnicodeEnv.MaximumLength = *EnvSize;
|
UnicodeEnv.MaximumLength = (USHORT)*EnvSize;
|
||||||
|
|
||||||
/* Convert */
|
/* Convert */
|
||||||
RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
|
RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
|
||||||
|
@ -754,7 +754,7 @@ CreateProcessInternalW(HANDLE hToken,
|
||||||
|
|
||||||
/* Easy stuff first, convert the process priority class */
|
/* Easy stuff first, convert the process priority class */
|
||||||
PriorityClass.Foreground = FALSE;
|
PriorityClass.Foreground = FALSE;
|
||||||
PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
|
PriorityClass.PriorityClass = (UCHAR)BasepConvertPriorityClass(dwCreationFlags);
|
||||||
|
|
||||||
if (lpCommandLine)
|
if (lpCommandLine)
|
||||||
{
|
{
|
||||||
|
@ -1158,7 +1158,7 @@ GetAppName:
|
||||||
PROCESS_ALL_ACCESS,
|
PROCESS_ALL_ACCESS,
|
||||||
ObjectAttributes,
|
ObjectAttributes,
|
||||||
NtCurrentProcess(),
|
NtCurrentProcess(),
|
||||||
bInheritHandles,
|
(BOOLEAN)bInheritHandles,
|
||||||
hSection,
|
hSection,
|
||||||
hDebug,
|
hDebug,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
@ -376,7 +376,7 @@ WinExec(LPCSTR lpCmdLine,
|
||||||
|
|
||||||
RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
|
RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
|
||||||
StartupInfo.cb = sizeof(STARTUPINFOA);
|
StartupInfo.cb = sizeof(STARTUPINFOA);
|
||||||
StartupInfo.wShowWindow = uCmdShow;
|
StartupInfo.wShowWindow = (WORD)uCmdShow;
|
||||||
StartupInfo.dwFlags = 0;
|
StartupInfo.dwFlags = 0;
|
||||||
|
|
||||||
if (! CreateProcessA(NULL,
|
if (! CreateProcessA(NULL,
|
||||||
|
@ -419,20 +419,6 @@ RegisterWaitForInputIdle (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
DWORD STDCALL
|
|
||||||
WaitForInputIdle (
|
|
||||||
HANDLE hProcess,
|
|
||||||
DWORD dwMilliseconds
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -460,7 +446,7 @@ GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
|
||||||
lpStartupInfo->dwYCountChars = Params->CountCharsY;
|
lpStartupInfo->dwYCountChars = Params->CountCharsY;
|
||||||
lpStartupInfo->dwFillAttribute = Params->FillAttribute;
|
lpStartupInfo->dwFillAttribute = Params->FillAttribute;
|
||||||
lpStartupInfo->dwFlags = Params->WindowFlags;
|
lpStartupInfo->dwFlags = Params->WindowFlags;
|
||||||
lpStartupInfo->wShowWindow = Params->ShowWindowFlags;
|
lpStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
|
||||||
lpStartupInfo->cbReserved2 = Params->RuntimeData.Length;
|
lpStartupInfo->cbReserved2 = Params->RuntimeData.Length;
|
||||||
lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
|
lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
|
||||||
|
|
||||||
|
@ -531,7 +517,7 @@ GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
|
||||||
lpLocalStartupInfo->dwYCountChars = Params->CountCharsY;
|
lpLocalStartupInfo->dwYCountChars = Params->CountCharsY;
|
||||||
lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute;
|
lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute;
|
||||||
lpLocalStartupInfo->dwFlags = Params->WindowFlags;
|
lpLocalStartupInfo->dwFlags = Params->WindowFlags;
|
||||||
lpLocalStartupInfo->wShowWindow = Params->ShowWindowFlags;
|
lpLocalStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
|
||||||
lpLocalStartupInfo->cbReserved2 = Params->RuntimeData.Length;
|
lpLocalStartupInfo->cbReserved2 = Params->RuntimeData.Length;
|
||||||
lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
|
lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include <k32.h>
|
#include <k32.h>
|
||||||
|
|
||||||
|
|
||||||
static _SEH_FILTER(lstr_page_fault)
|
static _SEH_FILTER(lstr_page_fault)
|
||||||
{
|
{
|
||||||
if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
|
if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
|
||||||
|
@ -72,7 +71,6 @@ lstrcmpiA(
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -38,7 +38,7 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
|
||||||
IN OUT PCRITICAL_SECTION CriticalSection,
|
IN OUT PCRITICAL_SECTION CriticalSection,
|
||||||
IN DWORD dwMilliseconds)
|
IN DWORD dwMilliseconds)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = 0;
|
||||||
LARGE_INTEGER TimeOut;
|
LARGE_INTEGER TimeOut;
|
||||||
PLARGE_INTEGER TimeOutPtr = NULL;
|
PLARGE_INTEGER TimeOutPtr = NULL;
|
||||||
|
|
||||||
|
@ -48,10 +48,11 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
|
||||||
TimeOutPtr = &TimeOut;
|
TimeOutPtr = &TimeOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
|
Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
|
||||||
(PRTL_CRITICAL_SECTION)CriticalSection,
|
(PRTL_CRITICAL_SECTION)CriticalSection,
|
||||||
TimeOutPtr);
|
TimeOutPtr);
|
||||||
|
#endif
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
@ -72,7 +73,7 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
|
||||||
IN DWORD dwMilliseconds,
|
IN DWORD dwMilliseconds,
|
||||||
IN ULONG Flags)
|
IN ULONG Flags)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = 0;
|
||||||
LARGE_INTEGER TimeOut;
|
LARGE_INTEGER TimeOut;
|
||||||
PLARGE_INTEGER TimeOutPtr = NULL;
|
PLARGE_INTEGER TimeOutPtr = NULL;
|
||||||
|
|
||||||
|
@ -82,11 +83,12 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
|
||||||
TimeOutPtr = &TimeOut;
|
TimeOutPtr = &TimeOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
|
Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
|
||||||
(PRTL_SRWLOCK)SRWLock,
|
(PRTL_SRWLOCK)SRWLock,
|
||||||
TimeOutPtr,
|
TimeOutPtr,
|
||||||
Flags);
|
Flags);
|
||||||
|
#endif
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
/* File contains Vista Semantics */
|
/* File contains Vista Semantics */
|
||||||
#undef _WIN32_WINNT
|
//#undef _WIN32_WINNT
|
||||||
#define _WIN32_WINNT 0x0600
|
//#define _WIN32_WINNT 0x0600
|
||||||
|
|
||||||
#include <k32.h>
|
#include <k32.h>
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ SetWaitableTimer(IN HANDLE hTimer,
|
||||||
(PLARGE_INTEGER)pDueTime,
|
(PLARGE_INTEGER)pDueTime,
|
||||||
(PTIMER_APC_ROUTINE)pfnCompletionRoutine,
|
(PTIMER_APC_ROUTINE)pfnCompletionRoutine,
|
||||||
lpArgToCompletionRoutine,
|
lpArgToCompletionRoutine,
|
||||||
fResume,
|
(BOOLEAN)fResume,
|
||||||
lPeriod,
|
lPeriod,
|
||||||
NULL);
|
NULL);
|
||||||
if (NT_SUCCESS(Status)) return TRUE;
|
if (NT_SUCCESS(Status)) return TRUE;
|
||||||
|
|
|
@ -838,7 +838,7 @@ SleepEx(DWORD dwMilliseconds,
|
||||||
* System time units are 100 nanoseconds (a nanosecond is a billionth of
|
* System time units are 100 nanoseconds (a nanosecond is a billionth of
|
||||||
* a second).
|
* a second).
|
||||||
*/
|
*/
|
||||||
Interval.QuadPart = -((ULONGLONG)dwMilliseconds * 10000);
|
Interval.QuadPart = -((LONGLONG)dwMilliseconds * 10000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -847,7 +847,7 @@ SleepEx(DWORD dwMilliseconds,
|
||||||
}
|
}
|
||||||
|
|
||||||
dowait:
|
dowait:
|
||||||
errCode = NtDelayExecution (bAlertable, &Interval);
|
errCode = NtDelayExecution ((BOOLEAN)bAlertable, &Interval);
|
||||||
if ((bAlertable) && (errCode == STATUS_ALERTED)) goto dowait;
|
if ((bAlertable) && (errCode == STATUS_ALERTED)) goto dowait;
|
||||||
return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0;
|
return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0;
|
||||||
}
|
}
|
||||||
|
@ -865,7 +865,7 @@ InternalWorkItemTrampoline(PVOID Context)
|
||||||
{
|
{
|
||||||
QUEUE_USER_WORKITEM_CONTEXT Info;
|
QUEUE_USER_WORKITEM_CONTEXT Info;
|
||||||
|
|
||||||
ASSERT(Context != NULL);
|
ASSERT(Context);
|
||||||
|
|
||||||
/* Save the context to the stack */
|
/* Save the context to the stack */
|
||||||
Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;
|
Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;
|
||||||
|
|
|
@ -2669,7 +2669,9 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG {
|
||||||
LIST_ENTRY ProcessLocksList;
|
LIST_ENTRY ProcessLocksList;
|
||||||
DWORD EntryCount;
|
DWORD EntryCount;
|
||||||
DWORD ContentionCount;
|
DWORD ContentionCount;
|
||||||
DWORD Spare[2];
|
DWORD Flags;
|
||||||
|
WORD CreatorBackTraceIndexHigh;
|
||||||
|
WORD SpareWORD;
|
||||||
} RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
|
} RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
|
||||||
typedef struct _RTL_CRITICAL_SECTION {
|
typedef struct _RTL_CRITICAL_SECTION {
|
||||||
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
|
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
|
||||||
|
|
Loading…
Reference in a new issue