- 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:
Alex Ionescu 2007-01-26 07:22:19 +00:00
parent 32a29de195
commit 35c5b063fd
34 changed files with 143 additions and 148 deletions

View file

@ -119,7 +119,7 @@ FindFirstChangeNotificationW (
NULL,//Buffer,
0,//BufferLength,
dwNotifyFilter,
bWatchSubtree);
(BOOLEAN)bWatchSubtree);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
@ -200,7 +200,7 @@ ReadDirectoryChangesW(
lpBuffer,
nBufferLength,
dwNotifyFilter,
bWatchSubtree
(BOOLEAN)bWatchSubtree
);
if (!NT_SUCCESS(Status))

View file

@ -781,7 +781,7 @@ GetShortPathNameW (
BOOLEAN spaces;
memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
ustr_buf[tmplen] = '\0';
ustr.Length = tmplen * sizeof(WCHAR);
ustr.Length = (USHORT)tmplen * sizeof(WCHAR);
if (RtlIsNameLegalDOS8Dot3(&ustr, NULL, &spaces) && !spaces)
{
sp += tmplen;
@ -889,7 +889,7 @@ SearchPathA (
goto Cleanup;
}
BufferU.MaximumLength = nBufferLength * sizeof(WCHAR);
BufferU.MaximumLength = (USHORT)nBufferLength * sizeof(WCHAR);
BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
BufferU.MaximumLength);
@ -899,7 +899,7 @@ SearchPathA (
goto Cleanup;
}
Buffer.MaximumLength = nBufferLength;
Buffer.MaximumLength = (USHORT)nBufferLength;
Buffer.Buffer = lpBuffer;
RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,

View file

@ -135,10 +135,10 @@ QueryDosDeviceA(
while (ucchMax)
{
CurrentLength = min (ucchMax, MAXUSHORT / 2);
TargetPathU.MaximumLength = TargetPathU.Length = CurrentLength * sizeof(WCHAR);
TargetPathU.MaximumLength = TargetPathU.Length = (USHORT)CurrentLength * sizeof(WCHAR);
TargetPathA.Length = 0;
TargetPathA.MaximumLength = CurrentLength;
TargetPathA.MaximumLength = (USHORT)CurrentLength;
RtlUnicodeStringToAnsiString (&TargetPathA,
&TargetPathU,

View file

@ -38,16 +38,16 @@ FilenameA2W(LPCSTR NameA, BOOL alloc)
PUNICODE_STRING pstrW;
NTSTATUS Status;
ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
//ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer));
RtlInitAnsiString(&str, NameA);
pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString;
if (bIsFileApiAnsi)
Status= RtlAnsiStringToUnicodeString( pstrW, &str, alloc );
Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
else
Status= RtlOemStringToUnicodeString( pstrW, &str, alloc );
Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
if (NT_SUCCESS(Status))
return pstrW->Buffer;
@ -85,7 +85,7 @@ FilenameU2A_FitOrFail(
ANSI_STRING str;
str.Buffer = DestA;
str.MaximumLength = destLen;
str.MaximumLength = (USHORT)destLen;
if (bIsFileApiAnsi)
@ -337,7 +337,7 @@ OpenFile(LPCSTR lpFileName,
0,
FileNameString.Buffer);
lpReOpenBuff->nErrCode = RtlNtStatusToDosError(errCode);
lpReOpenBuff->nErrCode = (WORD)RtlNtStatusToDosError(errCode);
if (!NT_SUCCESS(errCode))
{
@ -1541,7 +1541,7 @@ CheckNameLegalDOS8Dot3W(
if(lpOemName != NULL)
{
AnsiName.Buffer = lpOemName;
AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
AnsiName.Length = 0;
}
@ -1583,7 +1583,7 @@ CheckNameLegalDOS8Dot3A(
if(lpOemName != NULL)
{
AnsiName.Buffer = lpOemName;
AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
AnsiName.Length = 0;
}
@ -1628,7 +1628,7 @@ GetFinalPathNameByHandleA(IN HANDLE hFile,
cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
{
FilePathU.Length = 0;
FilePathU.MaximumLength = cchFilePath * sizeof(WCHAR);
FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR);
FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
0,
FilePathU.MaximumLength);

View file

@ -95,7 +95,7 @@ InternalCopyFindDataA(LPWIN32_FIND_DATAA lpFindFileData,
lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart;
lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart;
FileNameU.Length = FileNameU.MaximumLength = lpFileInfo->FileNameLength;
FileNameU.Length = FileNameU.MaximumLength = (USHORT)lpFileInfo->FileNameLength;
FileNameU.Buffer = lpFileInfo->FileName;
FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR);
@ -213,7 +213,7 @@ InternalFindFirstFile (
PWSTR SearchPath;
PWCHAR SearchPattern;
ULONG Length;
BOOLEAN bResult;
BOOL bResult;
DPRINT("FindFirstFileW(lpFileName %S)\n",
lpFileName);
@ -698,7 +698,7 @@ static VOID
InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
OUT LPVOID lpFindStreamData)
{
ASSERT(IData->pCurrent != NULL);
ASSERT(IData->pCurrent);
switch (IData->InfoLevel)
{

View file

@ -98,8 +98,8 @@ LockFileEx(
&Offset,
&BytesToLock,
0,
LockImmediate,
LockExclusive);
(BOOLEAN)LockImmediate,
(BOOLEAN)LockExclusive);
if ( !NT_SUCCESS(errCode) )
{
SetLastErrorByStatus (errCode);

View file

@ -919,7 +919,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
if(lpUserName != NULL)
{
UserNameW.MaximumLength = nMaxUserNameSize * sizeof(WCHAR);
UserNameW.MaximumLength = (USHORT)nMaxUserNameSize * sizeof(WCHAR);
UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength);
if (UserNameW.Buffer == NULL)
{
@ -929,7 +929,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
UserNameA.Buffer = lpUserName;
UserNameA.Length = 0;
UserNameA.MaximumLength = nMaxUserNameSize;
UserNameA.MaximumLength = (USHORT)nMaxUserNameSize;
}
Ret = GetNamedPipeHandleStateW(hNamedPipe,

View file

@ -106,7 +106,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
if (dwDriveMap & (1<<drive))
{
*p++ = 'A' + drive;
*p++ = 'A' + (UCHAR)drive;
*p++ = ':';
*p++ = '\\';
*p++ = '\0';
@ -464,7 +464,7 @@ GetVolumeInformationA(
if (lpVolumeNameBuffer)
{
VolumeNameU.MaximumLength = nVolumeNameSize * sizeof(WCHAR);
VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR);
VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
VolumeNameU.MaximumLength);
@ -477,7 +477,7 @@ GetVolumeInformationA(
if (lpFileSystemNameBuffer)
{
FileSystemNameU.Length = 0;
FileSystemNameU.MaximumLength = nFileSystemNameSize * sizeof(WCHAR);
FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR);
FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
FileSystemNameU.MaximumLength);
@ -511,7 +511,7 @@ FailNoMem:
{
VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
VolumeName.Length = 0;
VolumeName.MaximumLength = nVolumeNameSize;
VolumeName.MaximumLength = (USHORT)nVolumeNameSize;
VolumeName.Buffer = lpVolumeNameBuffer;
}
@ -519,7 +519,7 @@ FailNoMem:
{
FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
FileSystemName.Length = 0;
FileSystemName.MaximumLength = nFileSystemNameSize;
FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize;
FileSystemName.Buffer = lpFileSystemNameBuffer;
}

View file

@ -10,19 +10,15 @@
#define DPRINT
#endif
#define CHECKPOINT
#ifdef ASSERT
#undef ASSERT
#endif
#define ASSERT(x)
#else
#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);
#ifdef ASSERT
#undef ASSERT
#endif
#define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
#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 CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);

View file

@ -105,11 +105,11 @@ BasepInitializeContext(IN PCONTEXT Context,
VOID
STDCALL
BaseThreadStartupThunk();
BaseThreadStartupThunk(VOID);
VOID
STDCALL
BaseProcessStartThunk();
BaseProcessStartThunk(VOID);
__declspec(noreturn)
VOID

View file

@ -12,8 +12,8 @@
/* INCLUDES ******************************************************************/
/* PSDK/NDK Headers */
#define DBG 1
#define WIN32_NO_STATUS
#define NTOS_MODE_USER
#define _KERNEL32_
#include <windows.h>
#include <tlhelp32.h>
@ -29,7 +29,6 @@
/* DDK Driver Headers */
#include <ntddbeep.h>
#include <ntddser.h>
#include <mountmgr.h>
#include <mountdev.h>

View file

@ -5,15 +5,10 @@
<define name="_DISABLE_TIDENTS" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x0502</define>
<define name="_WIN32_WINNT">0x0600</define>
<define name="__NO_CTYPE_INLINES" />
<define name="WINVER">0x502</define>
<!--
!!! DO NOT ENABLE PCH! SOME FILES ARE NOT PCH-SAFE AS THEY DEFINE !!!
!!! _WIN32_WINNT DIFFERENTLY BEFORE INCLUDING k32.h !!!
<define name="WINVER">0x609</define>
<pch>k32.h</pch>
-->
<directory name="debug">
<file>debugger.c</file>
<file>output.c</file>

View file

@ -914,12 +914,12 @@ GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
/* Reset the right size and fill out the information */
lpBuffer->dwLength = sizeof(MEMORYSTATUS);
lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
lpBuffer->dwTotalPhys = lpBufferEx.ullTotalPhys;
lpBuffer->dwAvailPhys = lpBufferEx.ullAvailPhys;
lpBuffer->dwTotalPageFile = lpBufferEx.ullTotalPageFile;
lpBuffer->dwAvailPageFile = lpBufferEx.ullAvailPageFile;
lpBuffer->dwTotalVirtual = lpBufferEx.ullTotalVirtual;
lpBuffer->dwAvailVirtual = lpBufferEx.ullAvailVirtual;
lpBuffer->dwTotalPhys = (SIZE_T)lpBufferEx.ullTotalPhys;
lpBuffer->dwAvailPhys = (SIZE_T)lpBufferEx.ullAvailPhys;
lpBuffer->dwTotalPageFile = (SIZE_T)lpBufferEx.ullTotalPageFile;
lpBuffer->dwAvailPageFile = (SIZE_T)lpBufferEx.ullAvailPageFile;
lpBuffer->dwTotalVirtual = (SIZE_T)lpBufferEx.ullTotalVirtual;
lpBuffer->dwAvailVirtual = (SIZE_T)lpBufferEx.ullAvailVirtual;
}
}

View file

@ -157,8 +157,8 @@ HeapExtend(HANDLE hHeap,
{
NTSTATUS Status;
/* Call the RTL API */
Status = RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
/* Call the RTL API. Gone in Vista, so commented out. */
Status = STATUS_NOT_IMPLEMENTED; //RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
if (!NT_SUCCESS(Status))
{
/* We failed */
@ -185,7 +185,7 @@ HeapQueryTagW(HANDLE hHeap,
return RtlQueryTagHeap(hHeap,
dwFlags,
wTagIndex,
bResetCounters,
(BOOLEAN)bResetCounters,
lpTagInfo);
}
@ -204,8 +204,8 @@ HeapSummary(HANDLE hHeap,
/* Fill in the length information */
Usage.Length = sizeof(Usage);
/* Call RTL */
Status = RtlUsageHeap(hHeap, dwFlags, &Usage);
/* Call RTL. Gone in Vista, so commented out */
Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
if (!NT_SUCCESS(Status))
{
/* We failed */
@ -231,8 +231,8 @@ HeapUsage(HANDLE hHeap,
{
NTSTATUS Status;
/* Call RTL */
Status = RtlUsageHeap(hHeap, dwFlags, Usage);
/* Call RTL. Gone in Vista, so commented out */
Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
if (!NT_SUCCESS(Status))
{
/* We failed */

View file

@ -40,10 +40,10 @@ FindActCtxSectionStringA(
}
/* Call the Unicode function */
bRetVal = FindActCtxSectionStringA(dwFlags,
bRetVal = FindActCtxSectionStringW(dwFlags,
lpExtensionGuid,
ulSectionId,
lpStringToFind,
lpStringToFindW,
ReturnedData);
/* Clean up */

View file

@ -21,6 +21,24 @@
*/
#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
#include "../include/debug.h"
@ -331,7 +349,7 @@ COMMDCB_PARAM_HANDLER(data)
return FALSE;
/* success */
Dcb->ByteSize = nValue;
Dcb->ByteSize = (BYTE)nValue;
return TRUE;
}
@ -442,7 +460,7 @@ COMMDCB_PARAM_HANDLER(parity)
return FALSE;
/* success */
Dcb->Parity = nValue;
Dcb->Parity = (BYTE)nValue;
return TRUE;
}
@ -503,7 +521,7 @@ COMMDCB_PARAM_HANDLER(stop)
*StopBitsSet = TRUE;
/* success */
Dcb->StopBits = nValue;
Dcb->StopBits = (BYTE)nValue;
return TRUE;
}
@ -1112,8 +1130,8 @@ GetCommState(HANDLE hFile, LPDCB lpDCB)
if (HandFlow.FlowReplace & SERIAL_XOFF_CONTINUE) {
lpDCB->fTXContinueOnXoff = 1;
}
lpDCB->XonLim = HandFlow.XonLimit;
lpDCB->XoffLim = HandFlow.XoffLimit;
lpDCB->XonLim = (WORD)HandFlow.XonLimit;
lpDCB->XoffLim = (WORD)HandFlow.XoffLimit;
result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL);

View file

@ -144,7 +144,7 @@ GetComputerNameExW (
case ComputerNameDnsFullyQualified:
ResultString.Length = 0;
ResultString.MaximumLength = *nSize * sizeof(WCHAR);
ResultString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
ResultString.Buffer = lpBuffer;
RtlZeroMemory(QueryTable, sizeof(QueryTable));
@ -238,15 +238,15 @@ GetComputerNameExA (
return ERROR_OUTOFMEMORY;
}
AnsiString.MaximumLength = *nSize;
AnsiString.MaximumLength = (USHORT)*nSize;
AnsiString.Length = 0;
AnsiString.Buffer = lpBuffer;
Result = GetComputerNameExW( NameType, TempBuffer, nSize );
if( Result ) {
UnicodeString.MaximumLength = *nSize * sizeof(WCHAR);
UnicodeString.Length = *nSize * sizeof(WCHAR);
UnicodeString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
UnicodeString.Length = (USHORT)*nSize * sizeof(WCHAR);
UnicodeString.Buffer = TempBuffer;
RtlUnicodeStringToAnsiString (&AnsiString,

View file

@ -483,7 +483,7 @@ GetConsoleCommandHistoryLengthA (DWORD Unknown0)
/*
* @unimplemented
*/
DWORD STDCALL
INT STDCALL
GetConsoleDisplayMode (LPDWORD lpdwMode)
/*
* FUNCTION: Get the console display mode
@ -592,7 +592,7 @@ GetConsoleInputWaitHandle (VOID)
/*
* @unimplemented
*/
DWORD STDCALL
INT STDCALL
GetCurrentConsoleFont(HANDLE hConsoleOutput,
BOOL bMaximumWindow,
PCONSOLE_FONT_INFO lpConsoleCurrentFont)
@ -1126,7 +1126,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput;
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;
SizeBytes = nChars * CharSize;
@ -1245,8 +1245,8 @@ IntReadConsole(HANDLE hConsoleInput,
Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput;
Request->Data.ReadConsoleRequest.Unicode = bUnicode;
Request->Data.ReadConsoleRequest.NrCharactersToRead = min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = CharsRead;
Request->Data.ReadConsoleRequest.NrCharactersToRead = (WORD)min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = (WORD)CharsRead;
Status = CsrClientCallServer(Request,
NULL,
CsrRequest,
@ -1477,7 +1477,7 @@ IntFillConsoleOutputCharacter(HANDLE hConsoleOutput,
else
Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter);
Request.Data.FillOutputRequest.Position = dwWriteCoord;
Request.Data.FillOutputRequest.Length = nLength;
Request.Data.FillOutputRequest.Length = (WORD)nLength;
Status = CsrClientCallServer(&Request, NULL,
CsrRequest,
sizeof(CSR_API_MESSAGE));
@ -2316,7 +2316,7 @@ IntWriteConsoleOutputCharacter(HANDLE hConsoleOutput,
Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
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;
memcpy(Request->Data.WriteConsoleOutputCharRequest.String, lpCharacter, BytesWrite);
@ -2430,7 +2430,7 @@ WriteConsoleOutputAttribute(
*lpNumberOfAttrsWritten = 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.Length = Size;
memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
@ -2479,9 +2479,9 @@ FillConsoleOutputAttribute(
CsrRequest = MAKE_CSR_API(FILL_OUTPUT_ATTRIB, CSR_CONSOLE);
Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput;
Request.Data.FillOutputAttribRequest.Attribute = wAttribute;
Request.Data.FillOutputAttribRequest.Attribute = (CHAR)wAttribute;
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 ) );
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
{
@ -2891,7 +2891,7 @@ SetConsoleTextAttribute(
CsrRequest = MAKE_CSR_API(SET_ATTRIB, CSR_CONSOLE);
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 ) );
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
{
@ -2975,7 +2975,7 @@ BOOL WINAPI
SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
BOOL Add)
{
BOOLEAN Ret;
BOOL Ret;
RtlEnterCriticalSection(&DllLock);
if (Add)
@ -3652,7 +3652,7 @@ GetConsoleInputExeNameA(DWORD nBufferLength, LPSTR lpBuffer)
RtlInitUnicodeString(&BufferU, Buffer);
BufferA.Length = 0;
BufferA.MaximumLength = nBufferLength;
BufferA.MaximumLength = (USHORT)nBufferLength;
BufferA.Buffer = lpBuffer;
RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);

View file

@ -323,7 +323,7 @@ DllMain(HANDLE hDll,
if (hDll == (HANDLE)0x7c800000)
{
PULONG Eip;
Eip = (PULONG)*(PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
Eip = (PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
0x9 +
FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
*Eip = (ULONG)BaseProcessStartThunk;

View file

@ -43,14 +43,14 @@ GetEnvironmentVariableA (
/* initialize ansi variable value string */
VarValue.Length = 0;
VarValue.MaximumLength = nSize;
VarValue.MaximumLength = (USHORT)nSize;
VarValue.Buffer = lpBuffer;
/* initialize unicode variable value string and allocate buffer */
VarValueU.Length = 0;
if (nSize != 0)
{
VarValueU.MaximumLength = (nSize - 1) * sizeof(WCHAR);
VarValueU.MaximumLength = (USHORT)(nSize - 1) * sizeof(WCHAR);
VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
nSize * sizeof(WCHAR));
@ -139,7 +139,7 @@ GetEnvironmentVariableW (
lpName);
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;
Status = RtlQueryEnvironmentVariable_U (NULL,
@ -298,10 +298,10 @@ GetEnvironmentStringsA (
DPRINT("EnvPtr %p\n", EnvPtr);
/* convert unicode environment to ansi */
UnicodeString.MaximumLength = Length * sizeof(WCHAR) + sizeof(WCHAR);
UnicodeString.MaximumLength = (USHORT)Length * sizeof(WCHAR) + sizeof(WCHAR);
UnicodeString.Buffer = EnvU;
AnsiString.MaximumLength = Length + 1;
AnsiString.MaximumLength = (USHORT)Length + 1;
AnsiString.Length = 0;
AnsiString.Buffer = EnvPtr;
@ -314,7 +314,7 @@ GetEnvironmentStringsA (
if (UnicodeString.Length > 0)
{
AnsiString.Length = 0;
AnsiString.MaximumLength = Length + 1 - (AnsiString.Buffer - EnvPtr);
AnsiString.MaximumLength = (USHORT)Length + 1 - (AnsiString.Buffer - EnvPtr);
RtlUnicodeStringToAnsiString (&AnsiString,
&UnicodeString,
@ -407,11 +407,11 @@ ExpandEnvironmentStringsA (
}
Destination.Length = 0;
Destination.MaximumLength = nSize;
Destination.MaximumLength = (USHORT)nSize;
Destination.Buffer = lpDst;
DestinationU.Length = 0;
DestinationU.MaximumLength = nSize * sizeof(WCHAR);
DestinationU.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
DestinationU.MaximumLength);
@ -473,7 +473,7 @@ ExpandEnvironmentStringsW (
(LPWSTR)lpSrc);
Destination.Length = 0;
Destination.MaximumLength = nSize * sizeof(WCHAR);
Destination.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
Destination.Buffer = lpDst;
Status = RtlExpandEnvironmentStrings_U (NULL,

View file

@ -104,7 +104,7 @@ static LPSTR load_messageA( HMODULE module, UINT id, WORD lang )
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
memcpy( buffer, mre->Text, len );
}
TRACE("returning %s\n", wine_dbgstr_a(buffer));
//TRACE("returning %s\n", wine_dbgstr_a(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;
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;
}
@ -187,9 +187,9 @@ DWORD WINAPI FormatMessageA(
else {
from = NULL;
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))
from = load_messageA( kernel32_handle, dwMessageId, dwLanguageId );
from = load_messageA( kernel32_handle, dwMessageId, (WORD)dwLanguageId );
if (!from)
{
@ -373,7 +373,7 @@ DWORD WINAPI FormatMessageA(
if (nSize && talloced<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) {
*((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced));
memcpy(*(LPSTR*)lpBuffer,target,talloced);
@ -439,9 +439,9 @@ DWORD WINAPI FormatMessageW(
else {
from = NULL;
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))
from = load_messageW( kernel32_handle, dwMessageId, dwLanguageId );
from = load_messageW( kernel32_handle, dwMessageId,(WORD)dwLanguageId );
if (!from)
{
@ -636,8 +636,8 @@ DWORD WINAPI FormatMessageW(
HeapFree(GetProcessHeap(),0,target);
HeapFree(GetProcessHeap(),0,from);
TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
*(LPWSTR*)lpBuffer : lpBuffer));
//TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
// *(LPWSTR*)lpBuffer : lpBuffer));
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
strlenW(*(LPWSTR*)lpBuffer):
strlenW(lpBuffer);

View file

@ -23,8 +23,6 @@
/* FIXME: these are included in winnls.h, however including this file causes alot of
conflicting type errors. */
#define LOCALE_SYEARMONTH 0x1006
#define LOCALE_IPAPERSIZE 0x100A
#define LOCALE_RETURN_NUMBER 0x20000000
#define LOCALE_USE_CP_ACP 0x40000000
#define LOCALE_LOCALEINFOFLAGSMASK (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP|LOCALE_RETURN_NUMBER)
@ -994,7 +992,7 @@ CompareStringW (
}
else
Result = RtlCompareUnicodeString(
&String1, &String2, dwCmpFlags & NORM_IGNORECASE);
&String1, &String2, (BOOLEAN)(dwCmpFlags & NORM_IGNORECASE));
if (Result) /* need to translate result */

View file

@ -85,7 +85,7 @@ static RTL_CRITICAL_SECTION_DEBUG NLS_FormatsCS_debug =
0, 0, &NLS_FormatsCS,
{ &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 };

View file

@ -315,7 +315,7 @@ GetModuleFileNameA (
else
{
FileName.Length = 0;
FileName.MaximumLength = nSize * sizeof(WCHAR);
FileName.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
FileName.Buffer = lpFilename;
/* convert unicode string to ansi (or oem) */
@ -383,7 +383,7 @@ GetModuleFileNameW (
else
{
FileName.Length = 0;
FileName.MaximumLength = nSize * sizeof(WCHAR);
FileName.MaximumLength =(USHORT)nSize * sizeof(WCHAR);
FileName.Buffer = lpFilename;
RtlCopyUnicodeString (&FileName,
@ -680,7 +680,8 @@ LoadModule (
HeapFree(GetProcessHeap(), 0, CommandLine);
/* 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.hProcess);

View file

@ -266,9 +266,9 @@ INT WINAPI GetExpandedNameA( LPSTR in, LPSTR out )
}
if (isalpha(head.lastchar)) {
if (fnislowercased)
head.lastchar=tolower(head.lastchar);
head.lastchar=(CHAR)tolower(head.lastchar);
else
head.lastchar=toupper(head.lastchar);
head.lastchar=(CHAR)toupper(head.lastchar);
}
/* now look where to replace the last character */

View file

@ -489,7 +489,7 @@ IntWideCharToMultiByteUTF8(UINT CodePage, DWORD Flags,
break;
}
TempLength--;
*MultiByteString++ = Char;
*MultiByteString++ = (CHAR)Char;
continue;
}

View file

@ -76,7 +76,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &PROFILE_CritSect,
{ &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 };
@ -121,7 +121,7 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int 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';
}

View file

@ -199,7 +199,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
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;
@ -221,7 +221,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
}
/* Use the allocated size */
UnicodeEnv.MaximumLength = *EnvSize;
UnicodeEnv.MaximumLength = (USHORT)*EnvSize;
/* Convert */
RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
@ -754,7 +754,7 @@ CreateProcessInternalW(HANDLE hToken,
/* Easy stuff first, convert the process priority class */
PriorityClass.Foreground = FALSE;
PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
PriorityClass.PriorityClass = (UCHAR)BasepConvertPriorityClass(dwCreationFlags);
if (lpCommandLine)
{
@ -1158,7 +1158,7 @@ GetAppName:
PROCESS_ALL_ACCESS,
ObjectAttributes,
NtCurrentProcess(),
bInheritHandles,
(BOOLEAN)bInheritHandles,
hSection,
hDebug,
NULL);

View file

@ -376,7 +376,7 @@ WinExec(LPCSTR lpCmdLine,
RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFOA);
StartupInfo.wShowWindow = uCmdShow;
StartupInfo.wShowWindow = (WORD)uCmdShow;
StartupInfo.dwFlags = 0;
if (! CreateProcessA(NULL,
@ -419,20 +419,6 @@ RegisterWaitForInputIdle (
return;
}
/*
* @unimplemented
*/
DWORD STDCALL
WaitForInputIdle (
HANDLE hProcess,
DWORD dwMilliseconds
)
{
return 0;
}
/*
* @implemented
*/
@ -460,7 +446,7 @@ GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
lpStartupInfo->dwYCountChars = Params->CountCharsY;
lpStartupInfo->dwFillAttribute = Params->FillAttribute;
lpStartupInfo->dwFlags = Params->WindowFlags;
lpStartupInfo->wShowWindow = Params->ShowWindowFlags;
lpStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
lpStartupInfo->cbReserved2 = Params->RuntimeData.Length;
lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
@ -531,7 +517,7 @@ GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
lpLocalStartupInfo->dwYCountChars = Params->CountCharsY;
lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute;
lpLocalStartupInfo->dwFlags = Params->WindowFlags;
lpLocalStartupInfo->wShowWindow = Params->ShowWindowFlags;
lpLocalStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
lpLocalStartupInfo->cbReserved2 = Params->RuntimeData.Length;
lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;

View file

@ -10,7 +10,6 @@
#include <k32.h>
static _SEH_FILTER(lstr_page_fault)
{
if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
@ -72,7 +71,6 @@ lstrcmpiA(
return Result;
}
/*
* @implemented
*/

View file

@ -38,7 +38,7 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
IN OUT PCRITICAL_SECTION CriticalSection,
IN DWORD dwMilliseconds)
{
NTSTATUS Status;
NTSTATUS Status = 0;
LARGE_INTEGER TimeOut;
PLARGE_INTEGER TimeOutPtr = NULL;
@ -48,10 +48,11 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
TimeOutPtr = &TimeOut;
}
#if 0
Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
(PRTL_CRITICAL_SECTION)CriticalSection,
TimeOutPtr);
#endif
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
@ -72,7 +73,7 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
IN DWORD dwMilliseconds,
IN ULONG Flags)
{
NTSTATUS Status;
NTSTATUS Status = 0;
LARGE_INTEGER TimeOut;
PLARGE_INTEGER TimeOutPtr = NULL;
@ -82,11 +83,12 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
TimeOutPtr = &TimeOut;
}
#if 0
Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
(PRTL_SRWLOCK)SRWLock,
TimeOutPtr,
Flags);
#endif
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);

View file

@ -9,8 +9,8 @@
/* INCLUDES *****************************************************************/
/* File contains Vista Semantics */
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
//#undef _WIN32_WINNT
//#define _WIN32_WINNT 0x0600
#include <k32.h>
@ -269,7 +269,7 @@ SetWaitableTimer(IN HANDLE hTimer,
(PLARGE_INTEGER)pDueTime,
(PTIMER_APC_ROUTINE)pfnCompletionRoutine,
lpArgToCompletionRoutine,
fResume,
(BOOLEAN)fResume,
lPeriod,
NULL);
if (NT_SUCCESS(Status)) return TRUE;

View file

@ -838,7 +838,7 @@ SleepEx(DWORD dwMilliseconds,
* System time units are 100 nanoseconds (a nanosecond is a billionth of
* a second).
*/
Interval.QuadPart = -((ULONGLONG)dwMilliseconds * 10000);
Interval.QuadPart = -((LONGLONG)dwMilliseconds * 10000);
}
else
{
@ -847,7 +847,7 @@ SleepEx(DWORD dwMilliseconds,
}
dowait:
errCode = NtDelayExecution (bAlertable, &Interval);
errCode = NtDelayExecution ((BOOLEAN)bAlertable, &Interval);
if ((bAlertable) && (errCode == STATUS_ALERTED)) goto dowait;
return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0;
}
@ -865,7 +865,7 @@ InternalWorkItemTrampoline(PVOID Context)
{
QUEUE_USER_WORKITEM_CONTEXT Info;
ASSERT(Context != NULL);
ASSERT(Context);
/* Save the context to the stack */
Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;

View file

@ -2669,7 +2669,9 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG {
LIST_ENTRY ProcessLocksList;
DWORD EntryCount;
DWORD ContentionCount;
DWORD Spare[2];
DWORD Flags;
WORD CreatorBackTraceIndexHigh;
WORD SpareWORD;
} RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
typedef struct _RTL_CRITICAL_SECTION {
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;