winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
November 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
951 discussions
Start a n
N
ew thread
Alexandre Julliard : ws2_32: Return a WSA error code from _is_blocking().
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: 4383a9d5364e3432341f2dec62c7d94e9d122b16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4383a9d5364e3432341f2dec…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 14:41:31 2018 +0100 ws2_32: Return a WSA error code from _is_blocking(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 67 +++++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 2ea4269..c6805d8 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1146,19 +1146,19 @@ static void _enable_event( HANDLE s, unsigned int event, SERVER_END_REQ; } -static NTSTATUS _is_blocking(SOCKET s, BOOL *ret) +static DWORD sock_is_blocking(SOCKET s, BOOL *ret) { - NTSTATUS status; + DWORD err; SERVER_START_REQ( get_socket_event ) { req->handle = wine_server_obj_handle( SOCKET2HANDLE(s) ); req->service = FALSE; req->c_event = 0; - status = wine_server_call( req ); + err = NtStatusToWSAError( wine_server_call( req )); *ret = (reply->state & FD_WINE_NONBLOCKING) == 0; } SERVER_END_REQ; - return status; + return err; } static unsigned int _get_sock_mask(SOCKET s) @@ -1181,7 +1181,7 @@ static void _sync_sock_state(SOCKET s) BOOL dummy; /* do a dummy wineserver request in order to let the wineserver run through its select loop once */ - (void)_is_blocking(s, &dummy); + sock_is_blocking(s, &dummy); } static void _get_sock_errors(SOCKET s, int *events) @@ -2761,12 +2761,13 @@ static int WS2_register_async_shutdown( SOCKET s, int type ) SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr, int *addrlen32) { NTSTATUS status; + DWORD err; SOCKET as; BOOL is_blocking; TRACE("socket %04lx\n", s ); - status = _is_blocking(s, &is_blocking); - if (status) + err = sock_is_blocking(s, &is_blocking); + if (err) goto error; do { @@ -2799,10 +2800,11 @@ SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr, int *addrlen32) release_sock_fd( s, fd ); } } while (is_blocking && status == STATUS_CANT_WAIT); + err = NtStatusToWSAError( status ); error: - set_error(status); - WARN(" -> ERROR %d\n", GetLastError()); + WARN(" -> ERROR %d\n", err); + SetLastError(err); return INVALID_SOCKET; } @@ -3467,7 +3469,6 @@ int WINAPI WS_connect(SOCKET s, const struct WS_sockaddr* name, int namelen) if (fd != -1) { - NTSTATUS status; BOOL is_blocking; int ret = do_connect(fd, name, namelen); if (ret == 0) @@ -3479,33 +3480,21 @@ int WINAPI WS_connect(SOCKET s, const struct WS_sockaddr* name, int namelen) _enable_event(SOCKET2HANDLE(s), FD_CONNECT|FD_READ|FD_WRITE, FD_CONNECT, FD_WINE_CONNECTED|FD_WINE_LISTENING); - status = _is_blocking( s, &is_blocking ); - if (status) - { - release_sock_fd( s, fd ); - set_error( status ); - return SOCKET_ERROR; - } - if (is_blocking) - { - int result; - /* block here */ - do_block(fd, POLLIN | POLLOUT, -1); - _sync_sock_state(s); /* let wineserver notice connection */ - /* retrieve any error codes from it */ - if (!(result = get_sock_error(s, FD_CONNECT_BIT))) goto connect_success; - SetLastError(result); - } - else + ret = sock_is_blocking( s, &is_blocking ); + if (!ret) { - SetLastError(WSAEWOULDBLOCK); + if (is_blocking) + { + do_block(fd, POLLIN | POLLOUT, -1); + _sync_sock_state(s); /* let wineserver notice connection */ + /* retrieve any error codes from it */ + if (!(ret = get_sock_error(s, FD_CONNECT_BIT))) goto connect_success; + } + else ret = WSAEWOULDBLOCK; } } - else - { - SetLastError(ret); - } release_sock_fd( s, fd ); + SetLastError(ret); } return SOCKET_ERROR; @@ -5667,11 +5656,7 @@ static int WS2_sendto( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, return 0; } - if ((err = _is_blocking( s, &is_blocking ))) - { - err = NtStatusToWSAError( err ); - goto error; - } + if ((err = sock_is_blocking( s, &is_blocking ))) goto error; if ( is_blocking ) { @@ -8096,11 +8081,7 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, if (n != -1) break; - if ((err = _is_blocking( s, &is_blocking ))) - { - err = NtStatusToWSAError( err ); - goto error; - } + if ((err = sock_is_blocking( s, &is_blocking ))) goto error; if ( is_blocking ) {
1
0
0
0
Alexandre Julliard : server: Return WSA error codes in socket events.
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: f670a162a0939be260cc4a84225fe8ba2c91f1f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f670a162a0939be260cc4a84…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 12:57:42 2018 +0100 server: Return WSA error codes in socket events. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 113 +++++++++++++++++++++++++++++++-------------------- server/sock.c | 31 +++++--------- 2 files changed, 80 insertions(+), 64 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f670a162a0939be260cc…
1
0
0
0
Greg Smith : kernel32: Ignore FileIoPriorityHintInfo in SetFileInformationByHandle().
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: f4b07ee8eceb1d85b2bfd521462d010db00bee29 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f4b07ee8eceb1d85b2bfd521…
Author: Greg Smith <codedonewell(a)gmail.com> Date: Mon Nov 19 07:13:50 2018 +1100 kernel32: Ignore FileIoPriorityHintInfo in SetFileInformationByHandle(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46130
Signed-off-by: Greg Smith <codedonewell(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/file.c | 5 +++-- dlls/kernel32/tests/file.c | 23 +++++++++++++++++++++++ dlls/ntdll/file.c | 12 ++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index eeccf67..3214d72 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1103,7 +1103,6 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c case FileStreamInfo: case FileIdBothDirectoryInfo: case FileIdBothDirectoryRestartInfo: - case FileIoPriorityHintInfo: case FileFullDirectoryInfo: case FileFullDirectoryRestartInfo: case FileStorageInfo: @@ -1118,7 +1117,9 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c case FileDispositionInfo: status = NtSetInformationFile( file, &io, info, size, FileDispositionInformation ); break; - + case FileIoPriorityHintInfo: + status = NtSetInformationFile( file, &io, info, size, FileIoPriorityHintInformation ); + break; case FileStandardInfo: case FileCompressionInfo: case FileAttributeTagInfo: diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 168bdd5..d1b76bb 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -4914,6 +4914,7 @@ static void test_SetFileInformationByHandle(void) FILE_STANDARD_INFO stdinfo = { {{0}},{{0}},0,FALSE,FALSE }; FILE_COMPRESSION_INFO compressinfo; FILE_DISPOSITION_INFO dispinfo; + DECLSPEC_ALIGN(8) FILE_IO_PRIORITY_HINT_INFO hintinfo; char tempFileName[MAX_PATH]; char tempPath[MAX_PATH]; HANDLE file; @@ -4950,6 +4951,28 @@ static void test_SetFileInformationByHandle(void) ret = pSetFileInformationByHandle(file, FileAttributeTagInfo, &fileattrinfo, sizeof(fileattrinfo)); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + SetLastError(0xdeadbeef); + hintinfo.PriorityHint = MaximumIoPriorityHintType; + ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + + hintinfo.PriorityHint = IoPriorityHintNormal; + ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); + ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError()); + + hintinfo.PriorityHint = IoPriorityHintVeryLow; + ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); + ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError()); + + SetLastError(0xdeadbeef); + ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo) - 1); + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError()); + + SetLastError(0xdeadbeef); + hintinfo.PriorityHint = IoPriorityHintVeryLow - 1; + ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + memset(&protinfo, 0, sizeof(protinfo)); protinfo.StructureVersion = 1; protinfo.StructureSize = sizeof(protinfo); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 7c8b8ed..a43fe71 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -2671,6 +2671,18 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, io->u.Status = STATUS_INFO_LENGTH_MISMATCH; break; + case FileIoPriorityHintInformation: + if (len >= sizeof(FILE_IO_PRIORITY_HINT_INFO)) + { + FILE_IO_PRIORITY_HINT_INFO *info = ptr; + if (info->PriorityHint < MaximumIoPriorityHintType) + TRACE( "ignoring FileIoPriorityHintInformation %u\n", info->PriorityHint ); + else + io->u.Status = STATUS_INVALID_PARAMETER; + } + else io->u.Status = STATUS_INFO_LENGTH_MISMATCH; + break; + case FileAllInformation: io->u.Status = STATUS_INVALID_INFO_CLASS; break;
1
0
0
0
Zhiyi Zhang : mountmgr: Add IOCTL_STORAGE_QUERY_PROPERTY stub.
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: 33de7fb7a8522052d34c0d26067720d007a9dad7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33de7fb7a8522052d34c0d26…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Mon Nov 19 10:54:42 2018 +0800 mountmgr: Add IOCTL_STORAGE_QUERY_PROPERTY stub. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/volume.c | 46 ++++++++++++++++++++++++++++ dlls/mountmgr.sys/device.c | 71 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 2de66cd..21a2b31 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -21,6 +21,7 @@ #include "wine/test.h" #include "winbase.h" #include "winioctl.h" +#include "ntddstor.h" #include <stdio.h> #include "ddk/ntddcdvd.h" @@ -590,6 +591,50 @@ static void test_disk_extents(void) CloseHandle( handle ); } +static void test_disk_query_property(void) +{ + STORAGE_PROPERTY_QUERY query = {0}; + STORAGE_DESCRIPTOR_HEADER header = {0}; + STORAGE_DEVICE_DESCRIPTOR descriptor = {0}; + HANDLE handle; + DWORD error; + DWORD size; + BOOL ret; + + handle = CreateFileA("\\\\.\\PhysicalDrive0", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + 0, 0); + if (handle == INVALID_HANDLE_VALUE) + { + win_skip("can't open \\\\.\\PhysicalDrive0 %#x\n", GetLastError()); + return; + } + + query.PropertyId = StorageDeviceProperty; + query.QueryType = PropertyStandardQuery; + + SetLastError(0xdeadbeef); + ret = DeviceIoControl(handle, IOCTL_STORAGE_QUERY_PROPERTY, &query, sizeof(query), &header, sizeof(header), &size, + NULL); + error = GetLastError(); + ok(ret, "expect ret %#x, got %#x\n", TRUE, ret); + ok(error == 0xdeadbeef, "expect err %#x, got err %#x\n", 0xdeadbeef, error); + ok(size == sizeof(header), "got size %d\n", size); + ok(header.Version == sizeof(descriptor), "got header.Version %d\n", header.Version); + ok(header.Size >= sizeof(descriptor), "got header.Size %d\n", header.Size); + + SetLastError(0xdeadbeef); + ret = DeviceIoControl(handle, IOCTL_STORAGE_QUERY_PROPERTY, &query, sizeof(query), &descriptor, sizeof(descriptor), + &size, NULL); + error = GetLastError(); + ok(ret, "expect ret %#x, got %#x\n", TRUE, ret); + ok(error == 0xdeadbeef, "expect err %#x, got err %#x\n", 0xdeadbeef, error); + ok(size == sizeof(descriptor), "got size %d\n", size); + ok(descriptor.Version == sizeof(descriptor), "got descriptor.Version %d\n", descriptor.Version); + ok(descriptor.Size >= sizeof(descriptor), "got descriptor.Size %d\n", descriptor.Size); + + CloseHandle(handle); +} + static void test_GetVolumePathNameA(void) { char volume_path[MAX_PATH], cwd[MAX_PATH]; @@ -1238,6 +1283,7 @@ START_TEST(volume) test_GetVolumeInformationA(); test_enum_vols(); test_disk_extents(); + test_disk_query_property(); test_GetVolumePathNamesForVolumeNameA(); test_GetVolumePathNamesForVolumeNameW(); test_cdrom_ioctl(); diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index f96b05e..6604b69 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -890,6 +890,74 @@ NTSTATUS query_dos_device( int letter, enum device_type *type, char **device, ch return status; } +static void query_property(IRP *irp) +{ + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + STORAGE_PROPERTY_QUERY *query = irp->AssociatedIrp.SystemBuffer; + + if (!irp->AssociatedIrp.SystemBuffer + || irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(STORAGE_PROPERTY_QUERY)) + { + irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER; + return; + } + + /* Try to persuade application not to check property */ + if (query->QueryType == PropertyExistsQuery) + { + irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; + return; + } + + switch (query->PropertyId) + { + case StorageDeviceProperty: + { + STORAGE_DEVICE_DESCRIPTOR *descriptor; + + if (!irp->UserBuffer + || irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(STORAGE_DESCRIPTOR_HEADER)) + irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER; + else if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(STORAGE_DEVICE_DESCRIPTOR)) + { + descriptor = irp->UserBuffer; + descriptor->Version = sizeof(STORAGE_DEVICE_DESCRIPTOR); + descriptor->Size = sizeof(STORAGE_DEVICE_DESCRIPTOR); + irp->IoStatus.Information = sizeof(STORAGE_DESCRIPTOR_HEADER); + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + else + { + FIXME( "Faking StorageDeviceProperty data\n" ); + + memset( irp->UserBuffer, 0, irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + descriptor = irp->UserBuffer; + descriptor->Version = sizeof(STORAGE_DEVICE_DESCRIPTOR); + descriptor->Size = sizeof(STORAGE_DEVICE_DESCRIPTOR); + descriptor->DeviceType = FILE_DEVICE_DISK; + descriptor->DeviceTypeModifier = 0; + descriptor->RemovableMedia = FALSE; + descriptor->CommandQueueing = FALSE; + descriptor->VendorIdOffset = 0; + descriptor->ProductIdOffset = 0; + descriptor->ProductRevisionOffset = 0; + descriptor->SerialNumberOffset = 0; + descriptor->BusType = BusTypeScsi; + descriptor->RawPropertiesLength = 0; + + irp->IoStatus.Information = sizeof(STORAGE_DEVICE_DESCRIPTOR); + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + + break; + } + default: + FIXME( "Unsupported property %#x\n", query->PropertyId ); + irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; + break; + } +} + /* handler for ioctls on the harddisk device */ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) { @@ -962,6 +1030,9 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) irp->IoStatus.u.Status = STATUS_SUCCESS; break; } + case IOCTL_STORAGE_QUERY_PROPERTY: + query_property( irp ); + break; default: { ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode;
1
0
0
0
Józef Kucia : widl: Guard RPC includes with #ifdef _WIN32.
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: b7402ddbbecdfaa81daa657fbb5d37661f401434 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b7402ddbbecdfaa81daa657f…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Nov 19 15:07:02 2018 +0100 widl: Guard RPC includes with #ifdef _WIN32. This makes it easier to use header files generated by widl without Windows headers. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/header.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index defc7f8..ef141d9 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -1784,15 +1784,15 @@ void write_header(const statement_list_t *stmts) } fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n\n", PACKAGE_VERSION, input_name); + fprintf(header, "#ifdef _WIN32\n"); fprintf(header, "#ifndef __REQUIRED_RPCNDR_H_VERSION__\n"); fprintf(header, "#define __REQUIRED_RPCNDR_H_VERSION__ 475\n"); - fprintf(header, "#endif\n\n"); - + fprintf(header, "#endif\n"); fprintf(header, "#include <rpc.h>\n" ); fprintf(header, "#include <rpcndr.h>\n" ); if (!for_each_serializable(stmts, NULL, serializable_exists)) fprintf(header, "#include <midles.h>\n" ); - fprintf(header, "\n" ); + fprintf(header, "#endif\n\n"); fprintf(header, "#ifndef COM_NO_WINDOWS_H\n"); fprintf(header, "#include <windows.h>\n");
1
0
0
0
Zebediah Figura : setupapi/tests: Add more tests for creating and removing devices.
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: f86e79657452383a0af0544c28488f6d91015578 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f86e79657452383a0af0544c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 19 19:29:07 2018 -0600 setupapi/tests: Add more tests for creating and removing devices. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/tests/Makefile.in | 2 +- dlls/setupapi/tests/devinst.c | 117 +++++++++++++++++++++++++++++++++------- 2 files changed, 98 insertions(+), 21 deletions(-) diff --git a/dlls/setupapi/tests/Makefile.in b/dlls/setupapi/tests/Makefile.in index a656441..86e7ad2 100644 --- a/dlls/setupapi/tests/Makefile.in +++ b/dlls/setupapi/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = setupapi.dll -IMPORTS = setupapi user32 advapi32 shell32 +IMPORTS = advapi32 setupapi shell32 uuid user32 C_SRCS = \ devinst.c \ diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index ab051d8..f5d0f8c 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -329,13 +329,39 @@ static void test_install_class(void) DeleteFileA(tmpfile); } +static void check_device_info_(int line, HDEVINFO set, int index, const GUID *class, const char *expect_id) +{ + SP_DEVINFO_DATA device = {sizeof(device)}; + char id[50]; + BOOL ret; + + SetLastError(0xdeadbeef); + ret = SetupDiEnumDeviceInfo(set, index, &device); + if (expect_id) + { + ok_(__FILE__, line)(ret, "Got unexpected error %#x.\n", GetLastError()); + ok_(__FILE__, line)(IsEqualGUID(&device.ClassGuid, class), + "Got unexpected class %s.\n", wine_dbgstr_guid(&device.ClassGuid)); + ret = SetupDiGetDeviceInstanceIdA(set, &device, id, sizeof(id), NULL); + ok_(__FILE__, line)(ret, "Got unexpected error %#x.\n", GetLastError()); + ok_(__FILE__, line)(!strcasecmp(id, expect_id), "Got unexpected id %s.\n", id); + } + else + { + ok_(__FILE__, line)(!ret, "Expected failure.\n"); + ok_(__FILE__, line)(GetLastError() == ERROR_NO_MORE_ITEMS, + "Got unexpected error %#x.\n", GetLastError()); + } +} +#define check_device_info(a,b,c,d) check_device_info_(__LINE__,a,b,c,d) + static void test_device_info(void) { static const GUID deadbeef = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}}; - SP_DEVINFO_DATA device = {0}; - BOOL ret; + SP_DEVINFO_DATA device = {0}, ret_device = {sizeof(ret_device)}; HDEVINFO set; - DWORD i; + char id[50]; + BOOL ret; SetLastError(0xdeadbeef); ret = SetupDiCreateDeviceInfoA(NULL, NULL, NULL, NULL, NULL, 0, NULL); @@ -355,44 +381,95 @@ static void test_device_info(void) ok(!ret, "Expected failure.\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); - /* We can't add device information to the set with a different GUID */ SetLastError(0xdeadbeef); ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &deadbeef, NULL, NULL, 0, NULL); ok(!ret, "Expected failure.\n"); ok(GetLastError() == ERROR_CLASS_MISMATCH, "Got unexpected error %#x.\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &GUID_NULL, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_CLASS_MISMATCH, "Got unexpected error %#x.\n", GetLastError()); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, NULL); ok(ret, "Failed to create device, error %#x.\n", GetLastError()); - /* This fails because the device ID already exists.. */ + check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\0000"); + check_device_info(set, 1, &guid, NULL); + SetLastError(0xdeadbeef); ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, &device); ok(!ret, "Expected failure.\n"); ok(GetLastError() == ERROR_DEVINST_ALREADY_EXISTS, "Got unexpected error %#x.\n", GetLastError()); - /* whereas this "fails" because cbSize is wrong.. */ SetLastError(0xdeadbeef); - ret = SetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, DICD_GENERATE_ID, &device); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0001", &guid, NULL, NULL, 0, &device); ok(!ret, "Expected failure.\n"); ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "Got unexpected error %#x.\n", GetLastError()); - /* and this finally succeeds. */ - device.cbSize = sizeof(device); - ret = SetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, DICD_GENERATE_ID, &device); - ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\0000"); + check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\0001"); + check_device_info(set, 2, &guid, NULL); - /* There were three devices added, however - the second failure just - * resulted in the SP_DEVINFO_DATA not getting copied. */ - SetLastError(0xdeadbeef); - i = 0; - while (SetupDiEnumDeviceInfo(set, i, &device)) - i++; - ok(i == 3, "Expected 3 devices, got %d.\n", i); - ok(GetLastError() == ERROR_NO_MORE_ITEMS, "Got unexpected error %#x.\n", GetLastError()); + device.cbSize = sizeof(device); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0002", &guid, NULL, NULL, 0, &device); + ok(ret, "Got unexpected error %#x.\n", GetLastError()); + ok(IsEqualGUID(&device.ClassGuid, &guid), "Got unexpected class %s.\n", + wine_dbgstr_guid(&device.ClassGuid)); + ret = SetupDiGetDeviceInstanceIdA(set, &device, id, sizeof(id), NULL); + ok(ret, "Got unexpected error %#x.\n", GetLastError()); + ok(!strcmp(id, "ROOT\\LEGACY_BOGUS\\0002"), "Got unexpected id %s.\n", id); + + check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\0000"); + check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\0001"); + check_device_info(set, 2, &guid, "ROOT\\LEGACY_BOGUS\\0002"); + check_device_info(set, 3, &guid, NULL); ret = SetupDiRemoveDevice(set, &device); todo_wine - ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); + ok(ret, "Got unexpected error %#x.\n", GetLastError()); + + check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\0000"); + check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\0001"); + + ret = SetupDiEnumDeviceInfo(set, 2, &ret_device); + ok(ret, "Got unexpected error %#x.\n", GetLastError()); + ok(IsEqualGUID(&ret_device.ClassGuid, &guid), "Got unexpected class %s.\n", + wine_dbgstr_guid(&ret_device.ClassGuid)); + ret = SetupDiGetDeviceInstanceIdA(set, &ret_device, id, sizeof(id), NULL); +todo_wine { + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_NO_SUCH_DEVINST, "Got unexpected error %#x.\n", GetLastError()); +} + ok(ret_device.DevInst == device.DevInst, "Expected device node %#x, got %#x.\n", + device.DevInst, ret_device.DevInst); + + check_device_info(set, 3, &guid, NULL); + + SetupDiDestroyDeviceInfoList(set); + + set = SetupDiCreateDeviceInfoList(NULL, NULL); + ok(set != NULL, "Failed to create device info, error %#x.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", NULL, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); + + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\deadbeef", &deadbeef, NULL, NULL, 0, NULL); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\null", &GUID_NULL, NULL, NULL, 0, NULL); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\testguid", &guid, NULL, NULL, 0, NULL); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + + check_device_info(set, 0, &deadbeef, "ROOT\\LEGACY_BOGUS\\deadbeef"); + check_device_info(set, 1, &GUID_NULL, "ROOT\\LEGACY_BOGUS\\null"); + check_device_info(set, 2, &guid, "ROOT\\LEGACY_BOGUS\\testguid"); + check_device_info(set, 3, NULL, NULL); + SetupDiDestroyDeviceInfoList(set); }
1
0
0
0
Zebediah Figura : setupapi/tests: Remove workarounds in testCreateDeviceInfo().
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: 3af97988f1775de0767d98f2d2ffc8d32f610006 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3af97988f1775de0767d98f2…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 19 19:29:06 2018 -0600 setupapi/tests: Remove workarounds in testCreateDeviceInfo(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/tests/devinst.c | 124 +++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 69 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 1df049e..ab051d8 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -40,7 +40,6 @@ static HDEVINFO (WINAPI *pSetupDiCreateDeviceInfoListExW)(GUID*,HWND,PCWSTR,PVOI static BOOL (WINAPI *pSetupDiCreateDeviceInterfaceA)(HDEVINFO, PSP_DEVINFO_DATA, const GUID *, PCSTR, DWORD, PSP_DEVICE_INTERFACE_DATA); static BOOL (WINAPI *pSetupDiCallClassInstaller)(DI_FUNCTION, HDEVINFO, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiDestroyDeviceInfoList)(HDEVINFO); -static BOOL (WINAPI *pSetupDiEnumDeviceInfo)(HDEVINFO, DWORD, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiEnumDeviceInterfaces)(HDEVINFO, PSP_DEVINFO_DATA, const GUID *, DWORD, PSP_DEVICE_INTERFACE_DATA); static BOOL (WINAPI *pSetupDiGetINFClassA)(PCSTR, LPGUID, PSTR, DWORD, PDWORD); static HKEY (WINAPI *pSetupDiOpenClassRegKeyExA)(GUID*,REGSAM,DWORD,PCSTR,PVOID); @@ -77,7 +76,6 @@ static void init_function_pointers(void) pSetupDiCreateDeviceInterfaceA = (void *)GetProcAddress(hSetupAPI, "SetupDiCreateDeviceInterfaceA"); pSetupDiDestroyDeviceInfoList = (void *)GetProcAddress(hSetupAPI, "SetupDiDestroyDeviceInfoList"); pSetupDiCallClassInstaller = (void *)GetProcAddress(hSetupAPI, "SetupDiCallClassInstaller"); - pSetupDiEnumDeviceInfo = (void *)GetProcAddress(hSetupAPI, "SetupDiEnumDeviceInfo"); pSetupDiEnumDeviceInterfaces = (void *)GetProcAddress(hSetupAPI, "SetupDiEnumDeviceInterfaces"); pSetupDiGetDeviceInstanceIdA = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInstanceIdA"); pSetupDiGetDeviceInterfaceDetailA = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInterfaceDetailA"); @@ -331,83 +329,71 @@ static void test_install_class(void) DeleteFileA(tmpfile); } -static void testCreateDeviceInfo(void) +static void test_device_info(void) { + static const GUID deadbeef = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}}; + SP_DEVINFO_DATA device = {0}; BOOL ret; HDEVINFO set; + DWORD i; SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(NULL, NULL, NULL, NULL, NULL, 0, NULL); - ok(!ret, "Expected failure\n"); - ok(GetLastError() == ERROR_INVALID_DEVINST_NAME || - GetLastError() == ERROR_INVALID_PARAMETER /* NT4 */, - "Unexpected last error, got %08x\n", GetLastError()); + ret = SetupDiCreateDeviceInfoA(NULL, NULL, NULL, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_DEVINST_NAME, "Got unexpected error %#x.\n", GetLastError()); SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(NULL, "Root\\LEGACY_BOGUS\\0000", NULL, - NULL, NULL, 0, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "Expected ERROR_INVALID_HANDLEHANDLE, got %08x\n", GetLastError()); - set = pSetupDiCreateDeviceInfoList(&guid, NULL); - ok(set != NULL, "SetupDiCreateDeviceInfoList failed: %08x\n", - GetLastError()); - if (set) - { - SP_DEVINFO_DATA devInfo = { 0 }; - DWORD i; - static GUID deadbeef = - {0xdeadbeef, 0xdead, 0xbeef, {0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}}; + ret = SetupDiCreateDeviceInfoA(NULL, "Root\\LEGACY_BOGUS\\0000", NULL, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected error %#x.\n", GetLastError()); - /* No GUID given */ - SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", NULL, - NULL, NULL, 0, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); + set = SetupDiCreateDeviceInfoList(&guid, NULL); + ok(set != NULL, "Failed to create device info, error %#x.\n", GetLastError()); - /* We can't add device information to the set with a different GUID */ - SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", - &deadbeef, NULL, NULL, 0, NULL); - ok(!ret && GetLastError() == ERROR_CLASS_MISMATCH, - "Expected ERROR_CLASS_MISMATCH, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", NULL, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); - /* Finally, with all three required parameters, this succeeds: */ - ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, - NULL, NULL, 0, NULL); - ok(ret, "SetupDiCreateDeviceInfoA failed: %08x\n", GetLastError()); - /* This fails because the device ID already exists.. */ - SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, - NULL, NULL, 0, &devInfo); - ok(!ret && GetLastError() == ERROR_DEVINST_ALREADY_EXISTS, - "Expected ERROR_DEVINST_ALREADY_EXISTS, got %08x\n", GetLastError()); - /* whereas this "fails" because cbSize is wrong.. */ - SetLastError(0xdeadbeef); - ret = pSetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, - DICD_GENERATE_ID, &devInfo); - ok(!ret && GetLastError() == ERROR_INVALID_USER_BUFFER, - "Expected ERROR_INVALID_USER_BUFFER, got %08x\n", GetLastError()); - /* and this finally succeeds. */ - devInfo.cbSize = sizeof(devInfo); - ret = pSetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, - DICD_GENERATE_ID, &devInfo); - ok(ret, "SetupDiCreateDeviceInfoA failed: %08x\n", GetLastError()); - /* There were three devices added, however - the second failure just - * resulted in the SP_DEVINFO_DATA not getting copied. - */ - SetLastError(0xdeadbeef); - i = 0; - while (pSetupDiEnumDeviceInfo(set, i, &devInfo)) - i++; - ok(i == 3, "Expected 3 devices, got %d\n", i); - ok(GetLastError() == ERROR_NO_MORE_ITEMS, - "SetupDiEnumDeviceInfo failed: %08x\n", GetLastError()); + /* We can't add device information to the set with a different GUID */ + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &deadbeef, NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_CLASS_MISMATCH, "Got unexpected error %#x.\n", GetLastError()); - ret = pSetupDiRemoveDevice(set, &devInfo); - todo_wine ok(ret, "got %u\n", GetLastError()); - pSetupDiDestroyDeviceInfoList(set); - } + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, NULL); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + + /* This fails because the device ID already exists.. */ + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, &device); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_DEVINST_ALREADY_EXISTS, "Got unexpected error %#x.\n", GetLastError()); + + /* whereas this "fails" because cbSize is wrong.. */ + SetLastError(0xdeadbeef); + ret = SetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, DICD_GENERATE_ID, &device); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "Got unexpected error %#x.\n", GetLastError()); + + /* and this finally succeeds. */ + device.cbSize = sizeof(device); + ret = SetupDiCreateDeviceInfoA(set, "LEGACY_BOGUS", &guid, NULL, NULL, DICD_GENERATE_ID, &device); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + + /* There were three devices added, however - the second failure just + * resulted in the SP_DEVINFO_DATA not getting copied. */ + SetLastError(0xdeadbeef); + i = 0; + while (SetupDiEnumDeviceInfo(set, i, &device)) + i++; + ok(i == 3, "Expected 3 devices, got %d.\n", i); + ok(GetLastError() == ERROR_NO_MORE_ITEMS, "Got unexpected error %#x.\n", GetLastError()); + + ret = SetupDiRemoveDevice(set, &device); +todo_wine + ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); + SetupDiDestroyDeviceInfoList(set); } static void testGetDeviceInstanceId(void) @@ -1457,7 +1443,7 @@ START_TEST(devinst) win_skip("SetupDiOpenClassRegKeyExA is not available\n"); test_install_class(); - testCreateDeviceInfo(); + test_device_info(); testGetDeviceInstanceId(); testRegisterDeviceInfo(); testCreateDeviceInterface();
1
0
0
0
Zebediah Figura : setupapi/tests: Remove workarounds in testInstallClass() .
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: 7201eb5d7951ed1eba0cc16d39f331b33f85a19b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7201eb5d7951ed1eba0cc16d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 19 19:29:05 2018 -0600 setupapi/tests: Remove workarounds in testInstallClass(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/tests/devinst.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 9a8ecbc..1df049e 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -43,7 +43,6 @@ static BOOL (WINAPI *pSetupDiDestroyDeviceInfoList)(HDEVINFO); static BOOL (WINAPI *pSetupDiEnumDeviceInfo)(HDEVINFO, DWORD, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiEnumDeviceInterfaces)(HDEVINFO, PSP_DEVINFO_DATA, const GUID *, DWORD, PSP_DEVICE_INTERFACE_DATA); static BOOL (WINAPI *pSetupDiGetINFClassA)(PCSTR, LPGUID, PSTR, DWORD, PDWORD); -static BOOL (WINAPI *pSetupDiInstallClassA)(HWND, PCSTR, DWORD, HSPFILEQ); static HKEY (WINAPI *pSetupDiOpenClassRegKeyExA)(GUID*,REGSAM,DWORD,PCSTR,PVOID); static HKEY (WINAPI *pSetupDiOpenDevRegKey)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM); static HKEY (WINAPI *pSetupDiCreateDevRegKeyW)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, HINF, PCWSTR); @@ -83,7 +82,6 @@ static void init_function_pointers(void) pSetupDiGetDeviceInstanceIdA = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInstanceIdA"); pSetupDiGetDeviceInterfaceDetailA = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInterfaceDetailA"); pSetupDiGetDeviceInterfaceDetailW = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInterfaceDetailW"); - pSetupDiInstallClassA = (void *)GetProcAddress(hSetupAPI, "SetupDiInstallClassA"); pSetupDiOpenClassRegKeyExA = (void *)GetProcAddress(hSetupAPI, "SetupDiOpenClassRegKeyExA"); pSetupDiOpenDevRegKey = (void *)GetProcAddress(hSetupAPI, "SetupDiOpenDevRegKey"); pSetupDiCreateDevRegKeyW = (void *)GetProcAddress(hSetupAPI, "SetupDiCreateDevRegKeyW"); @@ -291,7 +289,7 @@ static void get_temp_filename(LPSTR path) lstrcpyA(path, ptr + 1); } -static void testInstallClass(void) +static void test_install_class(void) { static const WCHAR classKey[] = {'S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', @@ -307,27 +305,29 @@ static void testInstallClass(void) get_temp_filename(tmpfile + 2); create_inf_file(tmpfile + 2); - ret = pSetupDiInstallClassA(NULL, NULL, 0, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); - ret = pSetupDiInstallClassA(NULL, NULL, DI_NOVCP, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); - ret = pSetupDiInstallClassA(NULL, tmpfile + 2, DI_NOVCP, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); - ret = pSetupDiInstallClassA(NULL, tmpfile + 2, 0, NULL); - ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError()); + ret = SetupDiInstallClassA(NULL, NULL, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); + + ret = SetupDiInstallClassA(NULL, NULL, DI_NOVCP, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); + + ret = SetupDiInstallClassA(NULL, tmpfile + 2, DI_NOVCP, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %#x.\n", GetLastError()); + + ret = SetupDiInstallClassA(NULL, tmpfile + 2, 0, NULL); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Got unexpected error %#x.\n", GetLastError()); + /* The next call will succeed. Information is put into the registry but the * location(s) is/are depending on the Windows version. */ - ret = pSetupDiInstallClassA(NULL, tmpfile, 0, NULL); - ok(ret, "SetupDiInstallClassA failed: %08x\n", GetLastError()); - - ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, classKey), - "Couldn't delete classkey\n"); + ret = SetupDiInstallClassA(NULL, tmpfile, 0, NULL); + ok(ret, "Failed to install class, error %#x.\n", GetLastError()); + ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, classKey), "Failed to delete class key, error %u.\n", GetLastError()); DeleteFileA(tmpfile); } @@ -1456,7 +1456,7 @@ START_TEST(devinst) else win_skip("SetupDiOpenClassRegKeyExA is not available\n"); - testInstallClass(); + test_install_class(); testCreateDeviceInfo(); testGetDeviceInstanceId(); testRegisterDeviceInfo();
1
0
0
0
Zebediah Figura : shell32/tests: Remove some obsolete workarounds from test_ShellWindows().
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: a06d7de8929b9b15ed47c9b149cb72bef6149cc2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a06d7de8929b9b15ed47c9b1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 19 19:25:42 2018 -0600 shell32/tests: Remove some obsolete workarounds from test_ShellWindows(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shelldispatch.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index 0d38cd0..e9948ae 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -1025,18 +1025,14 @@ static void test_ShellWindows(void) hr = CoCreateInstance(&CLSID_ShellWindows, NULL, CLSCTX_LOCAL_SERVER, &IID_IShellWindows, (void**)&shellwindows); -#ifndef __i386__ -todo_wine -#endif ok(hr == S_OK, "got 0x%08x\n", hr); /* TODO: remove when explorer startup with clean prefix is fixed */ if (hr != S_OK) return; -if (0) /* NULL out argument - currently crashes on Wine */ { hr = IShellWindows_Register(shellwindows, NULL, 0, SWC_EXPLORER, NULL); ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "got 0x%08x\n", hr); -} + hr = IShellWindows_Register(shellwindows, NULL, 0, SWC_EXPLORER, &cookie); todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); @@ -1114,9 +1110,6 @@ todo_wine { IUnknown *unk; ok(disp != NULL, "got %p\n", disp); - - if (disp == NULL) goto skip_disp_tests; - ok(ret != HandleToUlong(hwnd), "got %d\n", ret); /* IDispatch-related tests */ @@ -1194,7 +1187,6 @@ if (hr == S_OK) { IServiceProvider_Release(sp); IDispatch_Release(disp); } -skip_disp_tests: disp = (void*)0xdeadbeef; ret = 0xdead;
1
0
0
0
Piotr Caban : ucrtbase: Add _o_malloc implementation.
by Alexandre Julliard
20 Nov '18
20 Nov '18
Module: wine Branch: master Commit: 25bb3b0be587cdc91f9e24765be4fc42738bdae4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=25bb3b0be587cdc91f9e2476…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Nov 20 01:00:41 2018 +0100 ucrtbase: Add _o_malloc implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- .../api-ms-win-crt-private-l1-1-0.spec | 2 +- dlls/ucrtbase/tests/misc.c | 21 +++++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index 9fc7723..60a9258 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -1015,7 +1015,7 @@ @ stub _o_lround @ stub _o_lroundf @ stub _o_lroundl -@ stub _o_malloc +@ cdecl _o_malloc(long) ucrtbase._o_malloc @ stub _o_mblen @ stub _o_mbrlen @ stub _o_mbrtoc16 diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 65e308c..ddb7938 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -136,6 +136,9 @@ static int (__cdecl *p_crt_at_quick_exit)(void (__cdecl *func)(void)); static void (__cdecl *p_quick_exit)(int exitcode); static int (__cdecl *p__stat32)(const char*, struct _stat32 *buf); static int (__cdecl *p__close)(int); +static void* (__cdecl *p__o_malloc)(size_t); +static size_t (__cdecl *p__msize)(void*); +static void (__cdecl *p_free)(void*); static void test__initialize_onexit_table(void) { @@ -496,6 +499,9 @@ static BOOL init(void) p_quick_exit = (void*)GetProcAddress(module, "quick_exit"); p__stat32 = (void*)GetProcAddress(module, "_stat32"); p__close = (void*)GetProcAddress(module, "_close"); + p__o_malloc = (void*)GetProcAddress(module, "_o_malloc"); + p__msize = (void*)GetProcAddress(module, "_msize"); + p_free = (void*)GetProcAddress(module, "free"); return TRUE; } @@ -1034,6 +1040,20 @@ static void test__stat32(void) } } +static void test__o_malloc(void) +{ + void *m; + size_t s; + + m = p__o_malloc(1); + ok(m != NULL, "p__o_malloc(1) returned NULL\n"); + + s = p__msize(m); + ok(s == 1, "_msize returned %d\n", (int)s); + + p_free(m); +} + START_TEST(misc) { int arg_c; @@ -1068,4 +1088,5 @@ START_TEST(misc) test_exit(arg_v[0]); test_quick_exit(arg_v[0]); test__stat32(); + test__o_malloc(); } diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 34e6b0e..6e6cc43 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -1706,7 +1706,7 @@ @ stub _o_lround @ stub _o_lroundf @ stub _o_lroundl -@ stub _o_malloc +@ cdecl _o_malloc(long) MSVCRT_malloc @ stub _o_mblen @ stub _o_mbrlen @ stub _o_mbrtoc16
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
96
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200