diff --git a/reactos/dll/win32/kernel32/file/cnotify.c b/reactos/dll/win32/kernel32/file/cnotify.c index 4e95d4ddb33..6dd6a9cc56c 100644 --- a/reactos/dll/win32/kernel32/file/cnotify.c +++ b/reactos/dll/win32/kernel32/file/cnotify.c @@ -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)) diff --git a/reactos/dll/win32/kernel32/file/dir.c b/reactos/dll/win32/kernel32/file/dir.c index 3c2a6ad1e88..43f86509d55 100644 --- a/reactos/dll/win32/kernel32/file/dir.c +++ b/reactos/dll/win32/kernel32/file/dir.c @@ -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, diff --git a/reactos/dll/win32/kernel32/file/dosdev.c b/reactos/dll/win32/kernel32/file/dosdev.c index b8491ea360b..781b1570866 100644 --- a/reactos/dll/win32/kernel32/file/dosdev.c +++ b/reactos/dll/win32/kernel32/file/dosdev.c @@ -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, diff --git a/reactos/dll/win32/kernel32/file/file.c b/reactos/dll/win32/kernel32/file/file.c index a5db894aaeb..6bfeb142a26 100644 --- a/reactos/dll/win32/kernel32/file/file.c +++ b/reactos/dll/win32/kernel32/file/file.c @@ -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); diff --git a/reactos/dll/win32/kernel32/file/find.c b/reactos/dll/win32/kernel32/file/find.c index 1e9be769456..792cb516d79 100644 --- a/reactos/dll/win32/kernel32/file/find.c +++ b/reactos/dll/win32/kernel32/file/find.c @@ -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) { diff --git a/reactos/dll/win32/kernel32/file/lock.c b/reactos/dll/win32/kernel32/file/lock.c index 14c7c03f179..1ced1b12e8c 100644 --- a/reactos/dll/win32/kernel32/file/lock.c +++ b/reactos/dll/win32/kernel32/file/lock.c @@ -98,8 +98,8 @@ LockFileEx( &Offset, &BytesToLock, 0, - LockImmediate, - LockExclusive); + (BOOLEAN)LockImmediate, + (BOOLEAN)LockExclusive); if ( !NT_SUCCESS(errCode) ) { SetLastErrorByStatus (errCode); diff --git a/reactos/dll/win32/kernel32/file/npipe.c b/reactos/dll/win32/kernel32/file/npipe.c index d34e04ef140..19f3e8f73e9 100644 --- a/reactos/dll/win32/kernel32/file/npipe.c +++ b/reactos/dll/win32/kernel32/file/npipe.c @@ -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, diff --git a/reactos/dll/win32/kernel32/file/volume.c b/reactos/dll/win32/kernel32/file/volume.c index 496d7755fe4..34c2cdb4115 100644 --- a/reactos/dll/win32/kernel32/file/volume.c +++ b/reactos/dll/win32/kernel32/file/volume.c @@ -106,7 +106,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength, for (drive = 0; drive < MAX_DOS_DRIVES; drive++) if (dwDriveMap & (1< #include @@ -29,7 +29,6 @@ /* DDK Driver Headers */ #include -#include #include #include diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild index 347dbb8b9b7..aa75cabf382 100644 --- a/reactos/dll/win32/kernel32/kernel32.rbuild +++ b/reactos/dll/win32/kernel32/kernel32.rbuild @@ -5,15 +5,10 @@ - 0x0502 + 0x0600 - 0x502 - debugger.c output.c diff --git a/reactos/dll/win32/kernel32/mem/global.c b/reactos/dll/win32/kernel32/mem/global.c index 820bd012860..f52f8c6f9c5 100644 --- a/reactos/dll/win32/kernel32/mem/global.c +++ b/reactos/dll/win32/kernel32/mem/global.c @@ -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; } } diff --git a/reactos/dll/win32/kernel32/mem/heap.c b/reactos/dll/win32/kernel32/mem/heap.c index 726e4545cf4..00af58dfd5e 100644 --- a/reactos/dll/win32/kernel32/mem/heap.c +++ b/reactos/dll/win32/kernel32/mem/heap.c @@ -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 */ diff --git a/reactos/dll/win32/kernel32/misc/actctx.c b/reactos/dll/win32/kernel32/misc/actctx.c index 4942cf5f862..a3d64d895e9 100644 --- a/reactos/dll/win32/kernel32/misc/actctx.c +++ b/reactos/dll/win32/kernel32/misc/actctx.c @@ -40,10 +40,10 @@ FindActCtxSectionStringA( } /* Call the Unicode function */ - bRetVal = FindActCtxSectionStringA(dwFlags, + bRetVal = FindActCtxSectionStringW(dwFlags, lpExtensionGuid, ulSectionId, - lpStringToFind, + lpStringToFindW, ReturnedData); /* Clean up */ diff --git a/reactos/dll/win32/kernel32/misc/comm.c b/reactos/dll/win32/kernel32/misc/comm.c index c385f34de8a..f7af83a0c8f 100644 --- a/reactos/dll/win32/kernel32/misc/comm.c +++ b/reactos/dll/win32/kernel32/misc/comm.c @@ -21,6 +21,24 @@ */ #include +#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 #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); diff --git a/reactos/dll/win32/kernel32/misc/computername.c b/reactos/dll/win32/kernel32/misc/computername.c index 11351b91c37..b2cd61f34f7 100644 --- a/reactos/dll/win32/kernel32/misc/computername.c +++ b/reactos/dll/win32/kernel32/misc/computername.c @@ -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, diff --git a/reactos/dll/win32/kernel32/misc/console.c b/reactos/dll/win32/kernel32/misc/console.c index 34cda0a5de7..783585eba17 100644 --- a/reactos/dll/win32/kernel32/misc/console.c +++ b/reactos/dll/win32/kernel32/misc/console.c @@ -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); diff --git a/reactos/dll/win32/kernel32/misc/dllmain.c b/reactos/dll/win32/kernel32/misc/dllmain.c index 16f7fa582c8..e3ce2f49f60 100644 --- a/reactos/dll/win32/kernel32/misc/dllmain.c +++ b/reactos/dll/win32/kernel32/misc/dllmain.c @@ -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; diff --git a/reactos/dll/win32/kernel32/misc/env.c b/reactos/dll/win32/kernel32/misc/env.c index 150c54fed6d..5ecc235d3d2 100644 --- a/reactos/dll/win32/kernel32/misc/env.c +++ b/reactos/dll/win32/kernel32/misc/env.c @@ -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, diff --git a/reactos/dll/win32/kernel32/misc/errormsg.c b/reactos/dll/win32/kernel32/misc/errormsg.c index 658a689778c..e9b6c332e9f 100644 --- a/reactos/dll/win32/kernel32/misc/errormsg.c +++ b/reactos/dll/win32/kernel32/misc/errormsg.c @@ -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= wcslen(value))) buffer[wcslen(buffer)-1] = '\0'; + if (quote && (len >= (int)wcslen(value))) buffer[wcslen(buffer)-1] = '\0'; } diff --git a/reactos/dll/win32/kernel32/process/create.c b/reactos/dll/win32/kernel32/process/create.c index 55e3248975c..bff53b778ca 100644 --- a/reactos/dll/win32/kernel32/process/create.c +++ b/reactos/dll/win32/kernel32/process/create.c @@ -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); diff --git a/reactos/dll/win32/kernel32/process/proc.c b/reactos/dll/win32/kernel32/process/proc.c index b32acdf80a4..bbfa5998f41 100644 --- a/reactos/dll/win32/kernel32/process/proc.c +++ b/reactos/dll/win32/kernel32/process/proc.c @@ -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; diff --git a/reactos/dll/win32/kernel32/string/lstring.c b/reactos/dll/win32/kernel32/string/lstring.c index eb9070a70eb..6bb9435033c 100644 --- a/reactos/dll/win32/kernel32/string/lstring.c +++ b/reactos/dll/win32/kernel32/string/lstring.c @@ -10,7 +10,6 @@ #include - static _SEH_FILTER(lstr_page_fault) { if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) @@ -72,7 +71,6 @@ lstrcmpiA( return Result; } - /* * @implemented */ diff --git a/reactos/dll/win32/kernel32/synch/condvar.c b/reactos/dll/win32/kernel32/synch/condvar.c index 7d1af63a8c4..f5de7c0093e 100644 --- a/reactos/dll/win32/kernel32/synch/condvar.c +++ b/reactos/dll/win32/kernel32/synch/condvar.c @@ -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); diff --git a/reactos/dll/win32/kernel32/synch/timer.c b/reactos/dll/win32/kernel32/synch/timer.c index 831f4fe1ffb..4170eeabb55 100644 --- a/reactos/dll/win32/kernel32/synch/timer.c +++ b/reactos/dll/win32/kernel32/synch/timer.c @@ -9,8 +9,8 @@ /* INCLUDES *****************************************************************/ /* File contains Vista Semantics */ -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 +//#undef _WIN32_WINNT +//#define _WIN32_WINNT 0x0600 #include @@ -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; diff --git a/reactos/dll/win32/kernel32/thread/thread.c b/reactos/dll/win32/kernel32/thread/thread.c index f8e0c108d90..c10db83b9f4 100644 --- a/reactos/dll/win32/kernel32/thread/thread.c +++ b/reactos/dll/win32/kernel32/thread/thread.c @@ -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; diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index a6cc9fb52f7..faaa0abe468 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -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;