Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2018
- 68 participants
- 1149 messages
[PATCH v5 3/8] kernel32/tests: Add GetSystemFirmwareTable tests
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/kernel32/tests/version.c | 42 +++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
index eb78a383d2..6ca45f0b2e 100644
--- a/dlls/kernel32/tests/version.c
+++ b/dlls/kernel32/tests/version.c
@@ -26,11 +26,17 @@
#include "winternl.h"
static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *);
+static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *);
static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *);
#define GET_PROC(func) \
p##func = (void *)GetProcAddress(hmod, #func);
+/* Firmware table providers */
+#define ACPI 0x41435049
+#define FIRM 0x4649524D
+#define RSMB 0x52534D42
+
static void init_function_pointers(void)
{
HMODULE hmod;
@@ -41,6 +47,7 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("ntdll.dll");
+ GET_PROC(NtQuerySystemInformation);
GET_PROC(RtlGetVersion);
}
@@ -697,6 +704,40 @@ static void test_VerifyVersionInfo(void)
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
}
+void test_GetSystemFirmwareTable(void)
+{
+ ULONG expected_len, i;
+ UINT len;
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, 16);
+ UCHAR *smbios_table = NULL;
+
+ ok(!!sfti, "Failed to allocate memory\n");
+ sfti->ProviderSignature = RSMB;
+ sfti->Action = SystemFirmwareTable_Get;
+ pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &expected_len);
+ sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, expected_len);
+ ok(!!sfti, "Failed to allocate memory\n");
+ pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, expected_len, &expected_len);
+
+ expected_len -= 16;
+ len = GetSystemFirmwareTable(RSMB, 0, smbios_table, 0);
+todo_wine
+ ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
+
+ smbios_table = HeapAlloc(GetProcessHeap(), 0, len);
+ len = GetSystemFirmwareTable(RSMB, 0, smbios_table, len);
+todo_wine
+ ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
+ for (i = 0; i < len; i++)
+ {
+ ok(smbios_table[i] == sfti->TableBuffer[i],
+ "Offset %u: Expected %02x, got %02x\n", i, sfti->TableBuffer[i], smbios_table[i]);
+ }
+
+ HeapFree(GetProcessHeap(), 0, sfti);
+ HeapFree(GetProcessHeap(), 0, smbios_table);
+}
+
START_TEST(version)
{
init_function_pointers();
@@ -704,4 +745,5 @@ START_TEST(version)
test_GetProductInfo();
test_GetVersionEx();
test_VerifyVersionInfo();
+ test_GetSystemFirmwareTable();
}
--
2.17.1
June 15, 2018
[PATCH v5 2/8] ntdll/tests: Add SystemFirmwareTableInformation tests
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/tests/info.c | 48 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 6c93c3cd58..cdb91e1b73 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -54,6 +54,11 @@ static DWORD one_before_last_pid = 0;
} \
} while(0)
+/* Firmware table providers */
+#define ACPI 0x41435049
+#define FIRM 0x4649524D
+#define RSMB 0x52534D42
+
static BOOL InitFunctionPtrs(void)
{
/* All needed functions are NT based, so using GetModuleHandle is a good check */
@@ -826,6 +831,45 @@ static void test_query_logicalprocex(void)
}
}
+static void test_query_firmware(void)
+{
+ ULONG len1, len2;
+ NTSTATUS status;
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16);
+
+ ok(!!sfti, "Failed to allocate memory\n");
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
+todo_wine
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
+todo_wine
+ ok(len1 == 16, "Expected length 16, got %u\n", len1);
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
+todo_wine
+ ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
+ ok(len1 == 0, "Expected length 0, got %u\n", len1);
+
+ sfti->ProviderSignature = RSMB;
+ sfti->Action = SystemFirmwareTable_Get;
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
+todo_wine
+ ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
+todo_wine
+ ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
+
+ sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
+ ok(!!sfti, "Failed to allocate memory\n");
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
+todo_wine
+ ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
+
+ HeapFree(GetProcessHeap(), 0, sfti);
+}
+
static void test_query_processor_power_info(void)
{
NTSTATUS status;
@@ -2267,6 +2311,10 @@ START_TEST(info)
trace("Starting test_process_debug_flags()\n");
test_query_process_debug_flags(argc, argv);
+ /* 0x4C SystemFirmwareTableInformation */
+ trace("Starting test_query_firmware()\n");
+ test_query_firmware();
+
/* belongs to its own file */
trace("Starting test_readvirtualmemory()\n");
test_readvirtualmemory();
--
2.17.1
June 15, 2018
[PATCH v5 1/8] include: Add SYSTEM_FIRMWARE_TABLE_INFORMATION to winternl.h
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
include/winternl.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/winternl.h b/include/winternl.h
index 58c475dfff..6e0bd987b6 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1579,6 +1579,23 @@ typedef struct _SYSTEM_TIME_ADJUSTMENT {
BOOLEAN TimeAdjustmentDisabled;
} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
+typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
+{
+ SystemFirmwareTable_Enumerate = 0,
+ SystemFirmwareTable_Get = 1
+} SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
+
+/* System Information Class 0x4C */
+
+typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
+{
+ ULONG ProviderSignature;
+ SYSTEM_FIRMWARE_TABLE_ACTION Action;
+ ULONG TableID;
+ ULONG TableBufferLength;
+ UCHAR TableBuffer[1];
+} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
+
typedef struct _TIME_FIELDS
{ CSHORT Year;
CSHORT Month;
--
2.17.1
June 15, 2018
[PATCH 2/2] iphlpapi: Improve parameter checking for IcmpSendEcho().
by Zhiyi Zhang
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/iphlpapi/icmp.c | 9 +++++++--
dlls/iphlpapi/tests/iphlpapi.c | 8 --------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c
index 7c91443598..c9603b7baa 100644
--- a/dlls/iphlpapi/icmp.c
+++ b/dlls/iphlpapi/icmp.c
@@ -290,11 +290,16 @@ DWORD WINAPI IcmpSendEcho(
if (IcmpHandle==INVALID_HANDLE_VALUE) {
/* FIXME: in fact win98 seems to ignore the handle value !!! */
- SetLastError(ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
+ if (!ReplyBuffer||!ReplySize) {
+ SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
- if (ReplySize<sizeof(ICMP_ECHO_REPLY)+ICMP_MINLEN) {
+ if (ReplySize<sizeof(ICMP_ECHO_REPLY)) {
SetLastError(IP_BUF_TOO_SMALL);
return 0;
}
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index f964878d68..ff381c5e29 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -966,7 +966,6 @@ static void testIcmpSendEcho(void)
ret = pIcmpSendEcho(INVALID_HANDLE_VALUE, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1009,20 +1008,16 @@ todo_wine
error = GetLastError();
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
- if (0) /* crashes in wine, remove IF when fixed */
- {
SetLastError(0xdeadbeef);
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error);
- }
SetLastError(0xdeadbeef);
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1031,7 +1026,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1049,7 +1043,6 @@ todo_wine
replysz = sizeof(ICMP_ECHO_REPLY);
ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000);
error = GetLastError();
-todo_wine
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef);
@@ -1071,7 +1064,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
--
2.17.1
June 15, 2018
[PATCH 1/2] iphlpapi: Use a standalone buffer in IcmpSendEcho().
by Zhiyi Zhang
Fix https://bugs.winehq.org/show_bug.cgi?id=43252
The old implementation uses user provided buffer to receive
packet data, which is alway not enough, causing data corruptions
or incorrectly timeout.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/iphlpapi/icmp.c | 38 +++++++++++++++++++++++++++-------
dlls/iphlpapi/tests/iphlpapi.c | 21 +++++++++++++++----
2 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c
index ebc2f2b65c..7c91443598 100644
--- a/dlls/iphlpapi/icmp.c
+++ b/dlls/iphlpapi/icmp.c
@@ -113,6 +113,9 @@ typedef struct {
#define IP_OPTS_DEFAULT 1
#define IP_OPTS_CUSTOM 2
+#define MAXIPLEN 60
+#define MAXICMPLEN 76
+
/* The sequence number is unique process wide, so that all threads
* have a distinct sequence number.
*/
@@ -270,13 +273,14 @@ DWORD WINAPI IcmpSendEcho(
icmp_t* icp=(icmp_t*)IcmpHandle;
unsigned char* reqbuf;
int reqsize;
+ unsigned char* repbuf;
+ int repsize;
struct icmp_echo_reply* ier;
struct ip* ip_header;
struct icmp* icmp_header;
char* endbuf;
int ip_header_len;
- int maxlen;
struct pollfd fdr;
DWORD send_time,recv_time;
struct sockaddr_in addr;
@@ -312,6 +316,16 @@ DWORD WINAPI IcmpSendEcho(
return 0;
}
+ /* max ip header + max icmp header and error data + reply size(max 65535 on Windows) */
+ /* FIXME: request size of 65535 is not supported yet because max buffer size of raw socket on linux is 32767 */
+ repsize=MAXIPLEN+MAXICMPLEN+(ReplySize&0xFFFF);
+ repbuf=HeapAlloc(GetProcessHeap(), 0, repsize);
+ if (reqbuf==NULL) {
+ HeapFree(GetProcessHeap(), 0, reqbuf);
+ SetLastError(ERROR_OUTOFMEMORY);
+ return 0;
+ }
+
icmp_header=(struct icmp*)reqbuf;
icmp_header->icmp_type=ICMP_ECHO;
icmp_header->icmp_code=0;
@@ -367,9 +381,7 @@ DWORD WINAPI IcmpSendEcho(
fdr.events = POLLIN;
addrlen=sizeof(addr);
ier=ReplyBuffer;
- ip_header=(struct ip *) ((char *) ReplyBuffer+sizeof(ICMP_ECHO_REPLY));
endbuf=(char *) ReplyBuffer+ReplySize;
- maxlen=ReplySize-sizeof(ICMP_ECHO_REPLY);
/* Send the packet */
TRACE("Sending %d bytes (RequestSize=%d) to %s\n", reqsize, RequestSize, inet_ntoa(addr.sin_addr));
@@ -407,10 +419,11 @@ DWORD WINAPI IcmpSendEcho(
}
/* Get the reply */
+ ip_header=(struct ip*)repbuf;
ip_header_len=0; /* because gcc was complaining */
while (poll(&fdr,1,Timeout)>0) {
recv_time = GetTickCount();
- res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,&addrlen);
+ res=recvfrom(icp->sid, (char*)repbuf, repsize, 0, (struct sockaddr*)&addr, &addrlen);
TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr));
ier->Status=IP_REQ_TIMED_OUT;
@@ -508,6 +521,12 @@ DWORD WINAPI IcmpSendEcho(
else Timeout = 0;
continue;
} else {
+ /* Check free space, should be large enough for an ICMP_ECHO_REPLY and remainning icmp data */
+ if (endbuf-(char *)ier < sizeof(struct icmp_echo_reply)+(res-ip_header_len-ICMP_MINLEN)) {
+ res=ier-(ICMP_ECHO_REPLY *)ReplyBuffer;
+ SetLastError(IP_GENERAL_FAILURE);
+ goto done;
+ }
/* This is a reply to our packet */
memcpy(&ier->Address,&ip_header->ip_src,sizeof(IPAddr));
/* Status is already set */
@@ -515,7 +534,7 @@ DWORD WINAPI IcmpSendEcho(
ier->DataSize=res-ip_header_len-ICMP_MINLEN;
ier->Reserved=0;
ier->Data=endbuf-ier->DataSize;
- memmove(ier->Data,((char*)ip_header)+ip_header_len+ICMP_MINLEN,ier->DataSize);
+ memcpy(ier->Data, ((char *)ip_header)+ip_header_len+ICMP_MINLEN, ier->DataSize);
ier->Options.Ttl=ip_header->ip_ttl;
ier->Options.Tos=ip_header->ip_tos;
ier->Options.Flags=ip_header->ip_off >> 13;
@@ -523,7 +542,7 @@ DWORD WINAPI IcmpSendEcho(
if (ier->Options.OptionsSize!=0) {
ier->Options.OptionsData=(unsigned char *) ier->Data-ier->Options.OptionsSize;
/* FIXME: We are supposed to rearrange the option's 'source route' data */
- memmove(ier->Options.OptionsData,((char*)ip_header)+ip_header_len,ier->Options.OptionsSize);
+ memcpy(ier->Options.OptionsData, ((char *)ip_header)+ip_header_len, ier->Options.OptionsSize);
endbuf=(char*)ier->Options.OptionsData;
} else {
ier->Options.OptionsData=NULL;
@@ -531,9 +550,8 @@ DWORD WINAPI IcmpSendEcho(
}
/* Prepare for the next packet */
+ endbuf-=ier->DataSize;
ier++;
- ip_header=(struct ip*)(((char*)ip_header)+sizeof(ICMP_ECHO_REPLY));
- maxlen=endbuf-(char*)ip_header;
/* Check out whether there is more but don't wait this time */
Timeout=0;
@@ -542,6 +560,10 @@ DWORD WINAPI IcmpSendEcho(
res=ier-(ICMP_ECHO_REPLY*)ReplyBuffer;
if (res==0)
SetLastError(IP_REQ_TIMED_OUT);
+ else
+ SetLastError(NO_ERROR);
+done:
+ HeapFree(GetProcessHeap(), 0, repbuf);
TRACE("received %d replies\n",res);
return res;
}
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index d5613d7b4b..f964878d68 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -951,6 +951,8 @@ static void testIcmpSendEcho(void)
char senddata[32], replydata[sizeof(senddata) + sizeof(ICMP_ECHO_REPLY)];
DWORD ret, error, replysz = sizeof(replydata);
IPAddr address;
+ ICMP_ECHO_REPLY *reply;
+ INT i;
if (!pIcmpSendEcho || !pIcmpCreateFile)
{
@@ -1038,12 +1040,10 @@ todo_wine
replysz = sizeof(replydata) - 1;
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
error = GetLastError();
- todo_wine {
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
- }
SetLastError(0xdeadbeef);
replysz = sizeof(ICMP_ECHO_REPLY);
@@ -1056,7 +1056,6 @@ todo_wine
replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN;
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000);
error = GetLastError();
-todo_wine
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef);
@@ -1064,7 +1063,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN + 1, NULL, replydata, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
@@ -1111,6 +1109,21 @@ todo_wine
{
skip ("Failed to ping with error %d, is lo interface down?.\n", error);
}
+
+ /* check reply data */
+ SetLastError(0xdeadbeef);
+ address = htonl(INADDR_LOOPBACK);
+ for (i = 0; i < ARRAY_SIZE(senddata); i++) senddata[i] = i & 0xff;
+ ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
+ error = GetLastError();
+ reply = (ICMP_ECHO_REPLY *)replydata;
+ ok(ret, "IcmpSendEcho failed unexpectedly\n");
+ ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08x\n", NO_ERROR, error);
+ ok(INADDR_LOOPBACK == ntohl(reply->Address), "Address mismatch, expect:%s, got: %s\n", ntoa(INADDR_LOOPBACK),
+ ntoa(reply->Address));
+ ok(reply->Status == IP_SUCCESS, "Expect status:0x%08x, got:0x%08x\n", IP_SUCCESS, reply->Status);
+ ok(reply->DataSize == sizeof(senddata), "Expect data size:%d, got:%d\n", sizeof(senddata), reply->DataSize);
+ ok(!memcmp(senddata, reply->Data, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n");
}
/*
--
2.17.1
June 15, 2018
[PATCH] kernel32: Always start debugger on WinSta0.
by Alistair Leslie-Hughes
From: Sebastian Lackner <sebastian(a)fds-team.de>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/kernel32/except.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c
index de244fc..5f2166e 100644
--- a/dlls/kernel32/except.c
+++ b/dlls/kernel32/except.c
@@ -304,6 +304,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
TRACE("Starting debugger %s\n", debugstr_a(cmdline));
memset(&startup, 0, sizeof(startup));
startup.cb = sizeof(startup);
+ startup.lpDesktop = (char *)"WinSta0";
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
ret = CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info);
--
1.9.1
June 15, 2018
[PATCH v3] comctl32/taskdialog: Add support for progress bar.
by Zhiyi Zhang
Rebase. Supersede 147419.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/taskdialog.c | 55 ++++++++++++++++++++++++++
dlls/comctl32/tests/taskdialog.c | 67 ++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c
index 07c031b2c7..1a5fad1609 100644
--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -57,6 +57,7 @@ struct taskdialog_info
HWND main_icon;
HWND main_instruction;
HWND content;
+ HWND progress_bar;
HWND *buttons;
INT button_count;
HWND default_button;
@@ -351,6 +352,17 @@ static void taskdialog_add_content(struct taskdialog_info *dialog_info)
taskdialog_hyperlink_enabled(dialog_info));
}
+static void taskdialog_add_progress_bar(struct taskdialog_info *dialog_info)
+{
+ const TASKDIALOGCONFIG *taskconfig = dialog_info->taskconfig;
+ DWORD style = PBS_SMOOTH | PBS_SMOOTHREVERSE | WS_CHILD | WS_VISIBLE;
+
+ if (!(taskconfig->dwFlags & (TDF_SHOW_PROGRESS_BAR | TDF_SHOW_MARQUEE_PROGRESS_BAR))) return;
+ if (taskconfig->dwFlags & TDF_SHOW_MARQUEE_PROGRESS_BAR) style |= PBS_MARQUEE;
+ dialog_info->progress_bar =
+ CreateWindowW(PROGRESS_CLASSW, NULL, style, 0, 0, 0, 0, dialog_info->hwnd, NULL, 0, NULL);
+}
+
static void taskdialog_add_button(struct taskdialog_info *dialog_info, HWND *button, INT_PTR id, const WCHAR *text,
BOOL custom_button)
{
@@ -464,6 +476,17 @@ static void taskdialog_layout(struct taskdialog_info *dialog_info)
/* Content */
taskdialog_label_layout(dialog_info, dialog_info->content, main_icon_right, dialog_width, &dialog_height, syslink);
+ /* Progress bar */
+ if (dialog_info->progress_bar)
+ {
+ x = main_icon_right + h_spacing;
+ y = dialog_height + v_spacing;
+ size.cx = dialog_width - x - h_spacing;
+ size.cy = GetSystemMetrics(SM_CYVSCROLL);
+ SetWindowPos(dialog_info->progress_bar, 0, x, y, size.cx, size.cy, SWP_NOZORDER);
+ dialog_height = y + size.cy;
+ }
+
dialog_height = max(dialog_height, main_icon_bottom);
/* Common and custom buttons */
@@ -598,6 +621,7 @@ static void taskdialog_init(struct taskdialog_info *dialog_info, HWND hwnd)
taskdialog_add_main_icon(dialog_info);
taskdialog_add_main_instruction(dialog_info);
taskdialog_add_content(dialog_info);
+ taskdialog_add_progress_bar(dialog_info);
taskdialog_add_buttons(dialog_info);
/* Set default button */
@@ -621,6 +645,7 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
{
static const WCHAR taskdialog_info_propnameW[] = {'T','a','s','k','D','i','a','l','o','g','I','n','f','o',0};
struct taskdialog_info *dialog_info;
+ LRESULT result;
TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
@@ -635,6 +660,36 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case TDM_ENABLE_BUTTON:
taskdialog_enable_button(dialog_info, wParam, lParam);
break;
+ case TDM_SET_MARQUEE_PROGRESS_BAR:
+ {
+ BOOL marquee = wParam;
+ LONG style;
+ if(!dialog_info->progress_bar) break;
+ style = GetWindowLongW(dialog_info->progress_bar, GWL_STYLE);
+ style = marquee ? style | PBS_MARQUEE : style & (~PBS_MARQUEE);
+ SetWindowLongW(dialog_info->progress_bar, GWL_STYLE, style);
+ break;
+ }
+ case TDM_SET_PROGRESS_BAR_STATE:
+ result = SendMessageW(dialog_info->progress_bar, PBM_SETSTATE, wParam, 0);
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_RANGE:
+ result = SendMessageW(dialog_info->progress_bar, PBM_SETRANGE, 0, lParam);
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_POS:
+ result = 0;
+ if (dialog_info->progress_bar)
+ {
+ LONG style = GetWindowLongW(dialog_info->progress_bar, GWL_STYLE);
+ if (!(style & PBS_MARQUEE)) result = SendMessageW(dialog_info->progress_bar, PBM_SETPOS, wParam, 0);
+ }
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_MARQUEE:
+ SendMessageW(dialog_info->progress_bar, PBM_SETMARQUEE, wParam, lParam);
+ break;
case WM_INITDIALOG:
dialog_info = (struct taskdialog_info *)lParam;
diff --git a/dlls/comctl32/tests/taskdialog.c b/dlls/comctl32/tests/taskdialog.c
index cca700cd18..e91a878876 100644
--- a/dlls/comctl32/tests/taskdialog.c
+++ b/dlls/comctl32/tests/taskdialog.c
@@ -373,6 +373,72 @@ static void test_timer(void)
pTaskDialogIndirect(&info, NULL, NULL, NULL);
}
+static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT notification, WPARAM wParam,
+ LPARAM lParam, LONG_PTR ref_data)
+{
+ unsigned long ret;
+ LONG flags = (LONG)ref_data;
+ if (notification == TDN_CREATED)
+ {
+ /* TDM_SET_PROGRESS_BAR_STATE */
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_NORMAL, 0);
+ ok(ret == PBST_NORMAL, "Expect state: %d got state: %lx\n", PBST_NORMAL, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_PAUSED, 0);
+ ok(ret == PBST_NORMAL, "Expect state: %d got state: %lx\n", PBST_NORMAL, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_ERROR, 0);
+ /* Progress bar has fixme on handling PBM_SETSTATE message */
+ todo_wine ok(ret == PBST_PAUSED, "Expect state: %d got state: %lx\n", PBST_PAUSED, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_NORMAL, 0);
+ todo_wine ok(ret == PBST_ERROR, "Expect state: %d got state: %lx\n", PBST_ERROR, ret);
+
+ /* TDM_SET_PROGRESS_BAR_RANGE */
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
+ ok(ret == MAKELONG(0, 100), "Expect range:%x got:%lx\n", MAKELONG(0, 100), ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
+ ok(ret == MAKELONG(0, 200), "Expect range:%x got:%lx\n", MAKELONG(0, 200), ret);
+
+ /* TDM_SET_PROGRESS_BAR_POS */
+ if (flags & TDF_SHOW_MARQUEE_PROGRESS_BAR)
+ {
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 1, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 2, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ }
+ else
+ {
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 1, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 2, 0);
+ ok(ret == 1, "Expect position:%x got:%lx\n", 1, ret);
+ }
+
+ SendMessageW(hwnd, TDM_CLICK_BUTTON, IDOK, 0);
+ }
+
+ return S_OK;
+}
+
+static void test_progress_bar(void)
+{
+ TASKDIALOGCONFIG info = {0};
+
+ info.cbSize = sizeof(TASKDIALOGCONFIG);
+ info.dwFlags = TDF_SHOW_PROGRESS_BAR;
+ info.pfCallback = taskdialog_callback_proc_progress_bar;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ info.dwCommonButtons = TDCBF_OK_BUTTON;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+
+ info.dwFlags = TDF_SHOW_MARQUEE_PROGRESS_BAR;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+
+ info.dwFlags = TDF_SHOW_PROGRESS_BAR | TDF_SHOW_MARQUEE_PROGRESS_BAR;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+}
+
START_TEST(taskdialog)
{
ULONG_PTR ctx_cookie;
@@ -411,6 +477,7 @@ START_TEST(taskdialog)
test_buttons();
test_help();
test_timer();
+ test_progress_bar();
unload_v6_module(ctx_cookie, hCtx);
}
--
2.17.1
June 15, 2018
Re: [PATCH] urlmon/tests: Use the available ARRAY_SIZE() macro
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39144
Your paranoid android.
=== wvistau64 (64 bit url) ===
url.c:1877: Test failed: binding failed: 800c0006, expected 00000000
url.c:1888: Test failed: res = 00002f4f, expected 00000000
url.c:3190: Test failed: expected OnProgress_SENDINGREQUEST
url.c:3198: Test failed: expected OnProgress_MIMETYPEAVAILABLE
url.c:3199: Test failed: expected OnProgress_BEGINDOWNLOADDATA
url.c:3200: Test failed: expected OnProgress_ENDDOWNLOADDATA
url.c:3212: Test failed: expected OnDataAvailable
=== w7pro64 (64 bit url) ===
url.c:3680: Test failed: CreateFile failed
url.c:1550: Test failed: unexpected call QueryInterface_IWindowForBindingUI
url.c:1420: Test failed: unexpected call QueryService_IWindowForBindingUI
url.c:1350: Test failed: unexpected call GetWindow_ICodeInstall
url.c:1877: Test failed: binding failed: 80040154, expected 00000000
url.c:3430: Test failed: expected Obj_OnProgress_CLASSIDAVAILABLE
url.c:3439: Test failed: expected OnObjectAvailable
June 14, 2018
[PATCH] winex11.drv: Correct compile without vulkan support
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/winex11.drv/vulkan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index 7eca31b..fdb858d 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -626,4 +626,8 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version)
return NULL;
}
+void wine_vk_surface_destroy(HWND hwnd)
+{
+}
+
#endif /* SONAME_LIBVULKAN */
--
1.9.1
June 14, 2018
Re: [PATCH] shell32/tests: Use the available ARRAY_SIZE() macro
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39142
Your paranoid android.
=== wvistau64_zh_CN (32 bit shlexec) ===
shlexec.c:2501: Test failed: ShellExecuteEx(mask="0x8540", file="C:\Users\winetest\AppData\Local\Temp\wt39B5.tmp\test file.sde") Assoc class="shlexec.sde", verb="Open", rawcmd="0", cmdtail="", ddeexec="[open("%1")]", app="shlexec", topic="dde" failed: rc=2 err=2
shlexec.c:2501: Test failed: ShellExecuteEx(mask="0x8540", file="C:\Users\winetest\AppData\Local\Temp\wt39B5.tmp\test file.sde") Assoc class="shlexec.sde", verb="Open", rawcmd="0", cmdtail=""%1"", ddeexec="[open("%1")]", app="shlexec", topic="dde" failed: rc=2 err=2
June 14, 2018