Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] The ultimate ros amd64 bringup #361

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
91c8699
[NTOS:IO] Fix parsing of resource lists
tkreuzer Jan 28, 2018
ff1eaad
[NTOS:MM] Make sure to call MmInitializeProcessAddressSpace() from th…
tkreuzer Jan 29, 2018
15a08e8
[NTOS:MM] In the x64 version of MmCreateProcessAddressSpace() zero ou…
tkreuzer Jan 29, 2018
cce3d16
[NTOS:MM] Fix ViewSize parameter passed to MiInsertVadEx() from MiCre…
tkreuzer Jan 29, 2018
286b2fb
[NTOS:MM] On x64 reserve the address range between FFFF800000000000 a…
tkreuzer Jan 29, 2018
12002d4
[HAL] Fix some 64 bit warnings
tkreuzer Jan 29, 2018
546c05b
[NTOS:OB] Fix some 64 bit warnings
tkreuzer Jan 29, 2018
1bc15af
[CRT] Use chkstk_ms.s on x64 builds
tkreuzer Jan 29, 2018
1f6d61b
[CRT] Remove the x64 asm version of sqrt from build
tkreuzer Jan 29, 2018
9e097de
[NTOS:IO] Fix a warning on MSVC builds
tkreuzer Jan 29, 2018
aedb9f6
[NTOS:MM] SLIST handling for kernel stacks
tkreuzer Feb 4, 2018
d139743
[NTOS:MM] Handle PPEs und PXEs as well in MmInitializeProcessAddressS…
tkreuzer Feb 4, 2018
25064d0
[NTOS:MM] Simplify and fix x64 version of MiGetPteForProcess(), fix M…
tkreuzer Feb 4, 2018
75e11df
[NTOS:MM] Fix session space initialization on x64
tkreuzer Feb 4, 2018
13ef07a
[NTOS:MM] Fix paged pool initialization on x64
tkreuzer Feb 4, 2018
03920b1
[NTOS:MM] Fix paged pool expansion
tkreuzer Feb 4, 2018
235566d
[NTOS:SE] Fix SeSetSecurityDescriptorInfoEx to avoid pool corruption …
tkreuzer Feb 4, 2018
1e326fb
[CMAKE] Add baseaddress_msvc_x64.cmake
tkreuzer Feb 4, 2018
c4fbc15
[CSRSRV] Fix type of ViewSize parameter passed to NtMapViewOfSection
tkreuzer Feb 4, 2018
29db059
[NTOS:KE] Implement KiConvertToGuiThread, KeSwitchKernelStack and sup…
tkreuzer Feb 4, 2018
c24203c
[NTOS:KE] Save and restore previous mode in KiZwSystemService and fix…
tkreuzer Feb 5, 2018
c9d1f6a
[NTOS:KE] Implement KiGetUserModeStackAddress() and KeUserModeCallback()
tkreuzer Feb 5, 2018
e503f53
[HAL][NTOS][I8042PRT] Add some hacks related to resource conflicts
tkreuzer Feb 5, 2018
9335f8f
[NTOS:MM] HACK: comment out an ASSERT that still fails on x64
tkreuzer Feb 5, 2018
4b4a334
[REACTOS] Fix many 64 bit warnings
tkreuzer Feb 6, 2018
945d807
[ENVIRON] Fix x64 build
tkreuzer Feb 6, 2018
a26ae1d
[BOOTLIB] Fix 64 bit warnings
tkreuzer Feb 6, 2018
bd078ab
[NTOS:KE] Improve kernel stack switching on GUI system calls
tkreuzer Feb 6, 2018
7749bdc
Fix indentation
tkreuzer Feb 6, 2018
177b3e7
Addendum to session space stuff
tkreuzer Feb 7, 2018
52721c2
Remove a trailing white space
tkreuzer Feb 7, 2018
fbec870
[NDK] Update x64 version of KEXCEPTION_FRAME
tkreuzer Feb 9, 2018
d5bdd7e
[NTOS:KE] Change the logic of KeSwitchKernelStack and friends to be s…
tkreuzer Feb 9, 2018
4351118
[ASM] Add initial version of kxamd64.inc
tkreuzer Feb 9, 2018
5b1588c
[NDK] Add UCALLOUT_FRAME definition
tkreuzer Feb 10, 2018
1dc22b6
[NTOS:KE] Move KiInitializeUserApc to usercall.c
tkreuzer Feb 10, 2018
8366b2c
[NTOS:KE] Simplify KiInitializeUserApc
tkreuzer Feb 10, 2018
29d20df
[NTOS:KE] Implement x64 version of user callback code
tkreuzer Feb 10, 2018
10e086b
[NDK] Fix the type of KPROCESS::ActiveProcessors
tkreuzer Feb 10, 2018
3252ac3
Silence annoying UNIMPLEMENTED messages
tkreuzer Feb 10, 2018
66eb02c
[NTOS:MM] Remove obsolete x64 debug print
tkreuzer Feb 10, 2018
c93d924
[NTOS:PS] Fix an issue with PROCESS_DEVICEMAP_INFORMATION size on 64…
tkreuzer Feb 10, 2018
c3380ef
[NTDLL] Delete obsolete file amd64/stubs.c
tkreuzer Feb 11, 2018
c249c15
[NTOS:PS] On x64 don't fail in NtSetInformationProcess with ProcessUs…
tkreuzer Feb 11, 2018
8b48097
[WIN32K] Fix ULONG/SIZE_T issue
tkreuzer Feb 11, 2018
e7e7e40
[NTOS:KE] Silence KiRundownThread, it has nothing to do
tkreuzer Feb 11, 2018
a9fc91d
[VIDEOPRT] Don't try to use NtVdmControl on x64
tkreuzer Feb 11, 2018
6e0a3be
[VIDEOPRT] [FORMATTING] No code change
tkreuzer Feb 11, 2018
f062e2d
[VIDEOPRT] Call IntInt10CallBios from VideoPortInt10, instead of code…
tkreuzer Feb 11, 2018
21177bb
[VIDEOPRT] Fixes for x64
tkreuzer Feb 11, 2018
ebe9bc4
[NDK] Add BIOS call API for amd64
tkreuzer Feb 11, 2018
c8bd63f
[FAST486] DWORD -> ULONG, so it can be used in kernel mode
tkreuzer Feb 11, 2018
4c80d83
[HAL] Implement amd64 BIOS call support
tkreuzer Feb 11, 2018
96f3020
[VIDEOPRT] Implement support for INT10 on x64 using the newly impleme…
tkreuzer Feb 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -267,7 +267,11 @@ else()
if(NO_ROSSYM)
include(sdk/cmake/baseaddress_dwarf.cmake)
elseif(MSVC)
include(sdk/cmake/baseaddress_msvc.cmake)
if (ARCH STREQUAL "amd64")
include(sdk/cmake/baseaddress_msvc_x64.cmake)
else()
include(sdk/cmake/baseaddress_msvc.cmake)
endif()
else()
include(sdk/cmake/baseaddress.cmake)
endif()
Expand Down
4 changes: 2 additions & 2 deletions base/applications/atactl/atactl.cpp
Expand Up @@ -445,7 +445,7 @@ ata_str_to_mode(
)
{
int mode;
int len;
size_t len;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is code synced with Aleksander Telyatnikov's code (from uniata), so maybe it would be interesting to surround the changes with #ifdef __REACTOS__ ... #endif.


if(!_stricmp(str, "SATA600"))
return ATA_SA600;
Expand Down Expand Up @@ -1688,7 +1688,7 @@ main (
)
{
//ULONG Flags = 0;
int i, j;
size_t i, j;
char a;
int bus_id = -1;
int dev_id = -1;
Expand Down
6 changes: 3 additions & 3 deletions base/applications/cmdutils/dbgprint/dbgprint.c
Expand Up @@ -17,9 +17,9 @@
int _tmain(int argc, TCHAR ** argv)
{
TCHAR * buf;
int bufsize;
size_t bufsize;
int i;
int offset;
size_t offset;

bufsize = 0;
for(i = 1; i < argc; i++)
Expand Down Expand Up @@ -106,7 +106,7 @@ int _tmain(int argc, TCHAR ** argv)
offset = 0;
for(i = 1; i < argc; i++)
{
int length = _tcslen(argv[i]);
size_t length = _tcslen(argv[i]);
_tcsncpy(&buf[offset], argv[i], length);
offset += length;
if (i + 1 < argc)
Expand Down
2 changes: 1 addition & 1 deletion base/applications/network/finger/net.c
Expand Up @@ -90,7 +90,7 @@ netfinger(char *name)
if (lflag)
send(s, "/W ", 3, 0);
/* send the name followed by <CR><LF> */
send(s, name, strlen(name), 0);
send(s, name, (int)strlen(name), 0);
send(s, "\r\n", 2, 0);

/*
Expand Down
6 changes: 3 additions & 3 deletions base/applications/network/ftp/fake.c
Expand Up @@ -120,14 +120,14 @@ const char *fprintfSocket(int s, const char *format, ...)
vsprintf(buffer, format, argptr);
va_end(argptr);

send(s, buffer, strlen(buffer), 0);
send(s, buffer, (int)strlen(buffer), 0);

return NULL;
}

const char *fputsSocket(const char *format, int s)
{
send(s, format, strlen(format), 0);
send(s, format, (int)strlen(format), 0);

return NULL;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ char *getpass (const char * prompt)
if (in == INVALID_HANDLE_VALUE || err == INVALID_HANDLE_VALUE)
return NULL;

if (WriteFile (err, prompt, strlen (prompt), &count, NULL))
if (WriteFile (err, prompt, (int)strlen(prompt), &count, NULL))
{
int istty = (GetFileType (in) == FILE_TYPE_CHAR);
DWORD old_flags;
Expand Down
6 changes: 3 additions & 3 deletions base/applications/network/ftp/main.c
Expand Up @@ -529,13 +529,13 @@ void help(int argc, const char *argv[])
struct cmd *c;

if (argc == 1) {
register int i, j, w, k;
int columns, width = 0, lines;
register int i, j, k;
size_t columns, width = 0, w, lines;
extern int NCMDS;

printf("Commands may be abbreviated. Commands are:\n\n");
for (c = cmdtab; c < &cmdtab[NCMDS]; c++) {
int len = strlen(c->c_name);
size_t len = strlen(c->c_name);

if (len > width)
width = len;
Expand Down
4 changes: 2 additions & 2 deletions base/applications/network/whois/whois.c
Expand Up @@ -156,12 +156,12 @@ int main(int argc, char **argv)
while (argc-- > 1)
{
/* Send the request */
send(s, *argv, strlen(*argv), 0);
send(s, *argv, (int)strlen(*argv), 0);
send(s, " ", 1, 0);
argv++;
}
/* Send the last request */
send(s, *argv, strlen(*argv), 0);
send(s, *argv, (int)strlen(*argv), 0);
send(s, "\r\n", 2, 0);

/* Receive anything and print it */
Expand Down
2 changes: 1 addition & 1 deletion base/applications/sc/config.c
Expand Up @@ -17,7 +17,7 @@ BOOL QueryConfig(LPCTSTR ServiceName)
DWORD cbBytesNeeded = 0;
LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;
LPWSTR lpPtr;
INT nLen, i;
SSIZE_T nLen, i;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to keep these signed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not. I just did it this way to avoid signed vs unsigned issues. Remember this is all about making 64 bits great again, not about fixing unrelated stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, but I don't intend to change it., since it is unrelated and can potentially cause issues.


#ifdef SCDBG
_tprintf(_T("service to show configuration - %s\n\n"), ServiceName);
Expand Down
2 changes: 1 addition & 1 deletion base/applications/sc/misc.c
Expand Up @@ -169,7 +169,7 @@ ParseFailureActions(
SC_ACTION *pActions = NULL;
LPTSTR pStringBuffer = NULL;
LPTSTR p;
INT nLength;
INT_PTR nLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not SIZE_T ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as with SSIZE_T.

INT nCount = 0;

*pcActions = 0;
Expand Down
2 changes: 1 addition & 1 deletion base/services/dhcpcsvc/dhcp/adapter.c
Expand Up @@ -9,7 +9,7 @@ PCHAR *GetSubkeyNames( PCHAR MainKeyName, PCHAR Append ) {
DWORD Error;
HKEY MainKey;
PCHAR *Out, OutKeyName;
DWORD CharTotal = 0, AppendLen = 1 + strlen(Append);
SIZE_T CharTotal = 0, AppendLen = 1 + strlen(Append);
DWORD MaxSubKeyLen = 0, MaxSubKeys = 0;

Error = RegOpenKey( HKEY_LOCAL_MACHINE, MainKeyName, &MainKey );
Expand Down
8 changes: 4 additions & 4 deletions base/services/dhcpcsvc/dhcp/dhclient.c
Expand Up @@ -435,7 +435,7 @@ void set_name_servers( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
DH_DbgPrint(MID_TRACE,("Setting DhcpNameserver: %s\n", nsbuf));

RegSetValueExA( RegKey, "DhcpNameServer", 0, REG_SZ,
(LPBYTE)nsbuf, strlen(nsbuf) + 1 );
(LPBYTE)nsbuf, (DWORD)strlen(nsbuf) + 1 );
free( nsbuf );
}

Expand Down Expand Up @@ -529,15 +529,15 @@ void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
&Adapter->NteContext,
&Adapter->NteInstance );
if (hkey) {
RegSetValueExA(hkey, "DhcpIPAddress", 0, REG_SZ, (LPBYTE)piaddr(new_lease->address), strlen(piaddr(new_lease->address))+1);
RegSetValueExA(hkey, "DhcpIPAddress", 0, REG_SZ, (LPBYTE)piaddr(new_lease->address), (DWORD)strlen(piaddr(new_lease->address))+1);
Buffer[0] = '\0';
for(i = 0; i < new_lease->options[DHO_SUBNET_MASK].len; i++)
{
sprintf(&Buffer[strlen(Buffer)], "%u", new_lease->options[DHO_SUBNET_MASK].data[i]);
if (i + 1 < new_lease->options[DHO_SUBNET_MASK].len)
strcat(Buffer, ".");
}
RegSetValueExA(hkey, "DhcpSubnetMask", 0, REG_SZ, (LPBYTE)Buffer, strlen(Buffer)+1);
RegSetValueExA(hkey, "DhcpSubnetMask", 0, REG_SZ, (LPBYTE)Buffer, (DWORD)strlen(Buffer)+1);
dwEnableDHCP = 1;
RegSetValueExA(hkey, "EnableDHCP", 0, REG_DWORD, (LPBYTE)&dwEnableDHCP, sizeof(DWORD));
}
Expand Down Expand Up @@ -575,7 +575,7 @@ void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
if (i + 1 < new_lease->options[DHO_ROUTERS].len)
strcat(Buffer, ".");
}
RegSetValueExA(hkey, "DhcpDefaultGateway", 0, REG_SZ, (LPBYTE)Buffer, strlen(Buffer)+1);
RegSetValueExA(hkey, "DhcpDefaultGateway", 0, REG_SZ, (LPBYTE)Buffer, (DWORD)strlen(Buffer)+1);
}
}

Expand Down
14 changes: 7 additions & 7 deletions base/services/dhcpcsvc/dhcp/hash.c
Expand Up @@ -48,7 +48,7 @@ static char copyright[] =

#include <rosdhcp.h>

static __inline int do_hash PROTO ((unsigned char *, int, int));
static __inline int do_hash PROTO ((unsigned char *, size_t, size_t));

struct hash_table *new_hash ()
{
Expand All @@ -62,12 +62,12 @@ struct hash_table *new_hash ()

static __inline int do_hash (name, len, size)
unsigned char *name;
int len;
int size;
size_t len;
size_t size;
{
register int accum = 0;
register unsigned char *s = name;
int i = len;
size_t i = len;
while (i--) {
/* Add the character in... */
accum += *s++;
Expand All @@ -81,7 +81,7 @@ static __inline int do_hash (name, len, size)

void add_hash (table, name, len, pointer)
struct hash_table *table;
int len;
size_t len;
unsigned char *name;
unsigned char *pointer;
{
Expand Down Expand Up @@ -109,7 +109,7 @@ void add_hash (table, name, len, pointer)

void delete_hash_entry (table, name, len)
struct hash_table *table;
int len;
size_t len;
unsigned char *name;
{
int hashno;
Expand Down Expand Up @@ -144,7 +144,7 @@ void delete_hash_entry (table, name, len)
unsigned char *hash_lookup (table, name, len)
struct hash_table *table;
unsigned char *name;
int len;
size_t len;
{
int hashno;
struct hash_bucket *bp;
Expand Down
5 changes: 3 additions & 2 deletions base/services/dhcpcsvc/dhcp/options.c
Expand Up @@ -451,7 +451,8 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
static char optbuf[32768]; /* XXX */
int hunksize = 0, numhunk = -1, numelem = 0;
char fmtbuf[32], *op = optbuf;
int i, j, k, opleft = sizeof(optbuf);
int i, j, k;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something's off about the indentation here.

size_t opleft = sizeof(optbuf);
unsigned char *dp = data;
struct in_addr foo;
char comma;
Expand Down Expand Up @@ -552,7 +553,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
/* Cycle through the array (or hunk) printing the data. */
for (i = 0; i < numhunk; i++) {
for (j = 0; j < numelem; j++) {
int opcount;
size_t opcount;
switch (fmtbuf[j]) {
case 't':
if (emit_quotes) {
Expand Down
4 changes: 2 additions & 2 deletions base/services/dhcpcsvc/dhcp/socket.c
Expand Up @@ -13,7 +13,7 @@ ssize_t send_packet( struct interface_info *ip,
struct sockaddr_in *broadcast,
struct hardware *hardware ) {
int result =
sendto( ip->wfdesc, (char *)p, size, 0,
sendto( ip->wfdesc, (char *)p, (int)size, 0,
(struct sockaddr *)broadcast, sizeof(*broadcast) );

if (result < 0) {
Expand All @@ -33,7 +33,7 @@ ssize_t receive_packet(struct interface_info *ip,
struct hardware *hardware ) {
int recv_addr_size = sizeof(*dest);
int result =
recvfrom (ip -> rfdesc, (char *)packet_data, packet_len, 0,
recvfrom (ip -> rfdesc, (char *)packet_data, (int)packet_len, 0,
(struct sockaddr *)dest, &recv_addr_size );
return result;
}
2 changes: 1 addition & 1 deletion base/services/dhcpcsvc/include/dhcpd.h
Expand Up @@ -261,7 +261,7 @@ struct protocol {
struct hash_bucket {
struct hash_bucket *next;
unsigned char *name;
int len;
size_t len;
unsigned char *value;
};

Expand Down
2 changes: 1 addition & 1 deletion base/services/schedsvc/job.c
Expand Up @@ -126,7 +126,7 @@ SaveJob(
0,
REG_SZ,
(PBYTE)pJob->Command,
(wcslen(pJob->Command) + 1) * sizeof(WCHAR));
(DWORD)(wcslen(pJob->Command) + 1) * sizeof(WCHAR));
if (lError != ERROR_SUCCESS)
goto done;

Expand Down
2 changes: 1 addition & 1 deletion base/services/schedsvc/rpcserver.c
Expand Up @@ -254,7 +254,7 @@ NetrJobEnum(
{
TRACE("dwIndex: %lu\n", dwIndex);
dwEntrySize = sizeof(AT_ENUM) +
(wcslen(CurrentJob->Command) + 1) * sizeof(WCHAR);
(DWORD)(wcslen(CurrentJob->Command) + 1) * sizeof(WCHAR);
TRACE("dwEntrySize: %lu\n", dwEntrySize);

if ((PreferedMaximumLength != ULONG_MAX) &&
Expand Down
2 changes: 1 addition & 1 deletion base/services/tcpsvcs/daytime.c
Expand Up @@ -14,7 +14,7 @@
static BOOL
SendTime(SOCKET sock, CHAR *time)
{
DWORD stringSize = strlen(time) + 1;
SIZE_T stringSize = strlen(time) + 1;
if (send(sock, time, stringSize, 0) == SOCKET_ERROR)
{
LogEvent(L"DayTime: Error sending data", WSAGetLastError(), 0, LOG_ERROR);
Expand Down
8 changes: 4 additions & 4 deletions base/services/tcpsvcs/log.c
Expand Up @@ -70,20 +70,20 @@ LogToFile(LPCWSTR lpMsg,
UINT flags)
{
LPWSTR lpFullMsg = NULL;
DWORD msgLen;
SIZE_T msgLen;

msgLen = wcslen(lpMsg) + 1;

if (flags & LOG_ERROR)
{
LPVOID lpSysMsg;
LPWSTR lpSysMsg;
DWORD eMsgLen;

eMsgLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
errNum,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpSysMsg,
(LPWSTR)&lpSysMsg,
0,
NULL);

Expand Down Expand Up @@ -130,7 +130,7 @@ LogToFile(LPCWSTR lpMsg,

bRet = WriteFile(hLogFile,
lpFullMsg,
wcslen(lpFullMsg) * sizeof(WCHAR),
(DWORD)wcslen(lpFullMsg) * sizeof(WCHAR),
Copy link
Member

@ThFabba ThFabba Feb 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of these casts are questionable. This one is an example of one that I consider outright wrong. You're silencing a legitimate warning about integer overflow without fixing the problem. I'd rather have the warning to help us in the future when we actually go and overflow-proof the codebase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @ThFabba, cast should be the last resort solution, and not the first tried solution.
Blindly casting can lead to severe issues, or even security issues and should be avoided.
I take for example this commit: 371aba1 (the root cause of this bug was a cast "to make MSVC build").

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would require:

  1. The original lpMsg to be 8GB minus the size of the format message
  2. Allocating more than 8GB on the heap
  3. _snwprintf, which only returns an int to write a string larger than 8GB
    But sure, I can add a RaiseException() here to deal with it, since the function is shitty to begin with and doesn't allow to return any failure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that these things are very unlikely to happen as accidents. Malicious actors tend to find a way to make them happen though, so it's a security concern. And I know that we only marginally care about security at this point -- which is why my recommendation was to just leave the warning be a warning.
That said, by all means feel free to fix it properly, whether that be an exception or silent truncation.

&bytesWritten,
&olWrite);
if (!bRet)
Expand Down
2 changes: 1 addition & 1 deletion base/services/tcpsvcs/qotd.c
Expand Up @@ -16,7 +16,7 @@ static WCHAR szFilePath[] = L"\\drivers\\etc\\quotes";
static BOOL
SendQuote(SOCKET sock, char* Quote)
{
INT strSize = strlen(Quote);
INT strSize = (INT)strlen(Quote);
if (send(sock, Quote, strSize, 0) == SOCKET_ERROR)
return FALSE;

Expand Down
4 changes: 2 additions & 2 deletions base/services/telnetd/telnetd.c
Expand Up @@ -174,7 +174,7 @@ static DWORD WINAPI UserLoginThread(LPVOID data)
gethostname(hostname, sizeof(hostname));
sprintf(welcome, "\r\nWelcome to %s, please identify yourself\r\n\r\nuser:", hostname);

if (send(client->socket, welcome, strlen(welcome), 0) < 0) {
if (send(client->socket, welcome, (int)strlen(welcome), 0) < 0) {
closesocket(client->socket);
free(client);
return 0;
Expand All @@ -190,7 +190,7 @@ static DWORD WINAPI UserLoginThread(LPVOID data)
}
}

if (send(client->socket, pwdPrompt, strlen(pwdPrompt), 0) < 0) {
if (send(client->socket, pwdPrompt, (int)strlen(pwdPrompt), 0) < 0) {
closesocket(client->socket);
free(client);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions base/system/smss/pagefile.c
Expand Up @@ -837,8 +837,8 @@ SmpCreateVolumeDescriptors(VOID)
/* Query the device map so we can get the drive letters */
Status = NtQueryInformationProcess(NtCurrentProcess(),
ProcessDeviceMap,
&ProcessInformation,
sizeof(ProcessInformation),
&ProcessInformation.Query,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks fine to me though I'm curious what problem the other version caused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the commit message

Copy link
Member

@ThFabba ThFabba Feb 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Didn't see it stand out among the other 53 commits ;)

sizeof(ProcessInformation.Query),
NULL);
if (!NT_SUCCESS(Status))
{
Expand Down