Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 1 participants
- 84549 discussions
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/iphlpapi/iphlpapi_main.c | 231 ++++++++++++++++------------------
1 file changed, 105 insertions(+), 126 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index b2e996a6241..d52441f022a 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -17,26 +17,13 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-
-#include "config.h"
-
#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
-#define USE_WS_PREFIX
#include "winsock2.h"
#include "winternl.h"
#include "ws2ipdef.h"
@@ -57,14 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
-#ifndef IF_NAMESIZE
-#define IF_NAMESIZE 16
-#endif
-
-#ifndef INADDR_NONE
-#define INADDR_NONE ~0UL
-#endif
-
#define CHARS_IN_GUID 39
static const WCHAR device_tcpip[] = {'\\','D','E','V','I','C','E','\\','T','C','P','I','P','_',0};
@@ -73,8 +52,8 @@ DWORD WINAPI AllocateAndGetIpAddrTableFromStack( MIB_IPADDRTABLE **table, BOOL s
static const NPI_MODULEID *ip_module_id( USHORT family )
{
- if (family == WS_AF_INET) return &NPI_MS_IPV4_MODULEID;
- if (family == WS_AF_INET6) return &NPI_MS_IPV6_MODULEID;
+ if (family == AF_INET) return &NPI_MS_IPV4_MODULEID;
+ if (family == AF_INET6) return &NPI_MS_IPV6_MODULEID;
return NULL;
}
@@ -245,7 +224,7 @@ DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
return ERROR_NOT_SUPPORTED;
}
-static char *debugstr_ipv6(const struct WS_sockaddr_in6 *sin, char *buf)
+static char *debugstr_ipv6(const struct sockaddr_in6 *sin, char *buf)
{
const IN6_ADDR *addr = &sin->sin6_addr;
char *p = buf;
@@ -278,14 +257,14 @@ static BOOL map_address_6to4( const SOCKADDR_IN6 *addr6, SOCKADDR_IN *addr4 )
{
ULONG i;
- if (addr6->sin6_family != WS_AF_INET6) return FALSE;
+ if (addr6->sin6_family != AF_INET6) return FALSE;
for (i = 0; i < 5; i++)
if (addr6->sin6_addr.u.Word[i]) return FALSE;
if (addr6->sin6_addr.u.Word[5] != 0xffff) return FALSE;
- addr4->sin_family = WS_AF_INET;
+ addr4->sin_family = AF_INET;
addr4->sin_port = addr6->sin6_port;
addr4->sin_addr.S_un.S_addr = addr6->sin6_addr.u.Word[6] << 16 | addr6->sin6_addr.u.Word[7];
memset( &addr4->sin_zero, 0, sizeof(addr4->sin_zero) );
@@ -305,7 +284,7 @@ static BOOL find_src_address( MIB_IPADDRTABLE *table, const SOCKADDR_IN *dst, SO
/* take the first address */
if (table->table[i].dwIndex == row.dwForwardIfIndex)
{
- src->sin6_family = WS_AF_INET6;
+ src->sin6_family = AF_INET6;
src->sin6_port = 0;
src->sin6_flowinfo = 0;
for (j = 0; j < 5; j++) src->sin6_addr.u.Word[j] = 0;
@@ -368,7 +347,7 @@ DWORD WINAPI CreateSortedAddressPairs( const PSOCKADDR_IN6 src_list, DWORD src_c
char buf[46];
FIXME( "source address for %s not found\n", debugstr_ipv6(&dst_list[i], buf) );
memset( pairs[i].SourceAddress, 0, sizeof(*pairs[i].SourceAddress) );
- pairs[i].SourceAddress->sin6_family = WS_AF_INET6;
+ pairs[i].SourceAddress->sin6_family = AF_INET6;
}
pairs[i].DestinationAddress = ptr++;
@@ -580,7 +559,7 @@ static DWORD get_wins_servers( SOCKADDR_INET **servers )
size = sizeof(buf);
if (!RegQueryValueExA( key, values[i], NULL, NULL, (LPBYTE)buf, &size ))
if (!RtlIpv4StringToAddressA( buf, TRUE, NULL, addrs + count ) &&
- addrs[count].WS_s_addr != INADDR_NONE && addrs[count].WS_s_addr != INADDR_ANY)
+ addrs[count].s_addr != INADDR_NONE && addrs[count].s_addr != INADDR_ANY)
count++;
}
RegCloseKey( key );
@@ -591,7 +570,7 @@ static DWORD get_wins_servers( SOCKADDR_INET **servers )
if (!*servers) return 0;
for (i = 0; i < count; i++)
{
- (*servers)[i].Ipv4.sin_family = WS_AF_INET;
+ (*servers)[i].Ipv4.sin_family = AF_INET;
(*servers)[i].Ipv4.sin_addr = addrs[i];
}
}
@@ -705,21 +684,21 @@ DWORD WINAPI GetAdaptersInfo( IP_ADAPTER_INFO *info, ULONG *size )
cursor->Next = extra_ip_addrs++;
cursor = cursor->Next;
}
- ConvertLengthToIpv4Mask( uni_rw[uni].on_link_prefix, &mask.WS_s_addr );
+ ConvertLengthToIpv4Mask( uni_rw[uni].on_link_prefix, &mask.s_addr );
ip_addr_string_init( cursor, &uni_keys[uni].addr, &mask, 0 );
}
if (!cursor)
{
- mask.WS_s_addr = INADDR_ANY;
+ mask.s_addr = INADDR_ANY;
ip_addr_string_init( &info->IpAddressList, &mask, &mask, 0 );
}
- gw.WS_s_addr = INADDR_ANY;
- mask.WS_s_addr = INADDR_NONE;
+ gw.s_addr = INADDR_ANY;
+ mask.s_addr = INADDR_NONE;
for (fwd = 0; fwd < fwd_count; fwd++)
{ /* find the first router on this interface */
if (fwd_keys[fwd].luid.Value == if_keys[i].Value &&
- fwd_keys[fwd].next_hop.WS_s_addr != INADDR_ANY &&
+ fwd_keys[fwd].next_hop.s_addr != INADDR_ANY &&
!fwd_keys[fwd].prefix_len)
{
gw = fwd_keys[fwd].next_hop;
@@ -735,7 +714,7 @@ DWORD WINAPI GetAdaptersInfo( IP_ADAPTER_INFO *info, ULONG *size )
ip_addr_string_init( &info->SecondaryWinsServer, NULL, NULL, 0 );
if (info->HaveWins)
{
- mask.WS_s_addr = INADDR_NONE;
+ mask.s_addr = INADDR_NONE;
ip_addr_string_init( &info->PrimaryWinsServer, &wins_servers[0].Ipv4.sin_addr, &mask, 0 );
if (wins_server_count > 1)
ip_addr_string_init( &info->SecondaryWinsServer, &wins_servers[1].Ipv4.sin_addr, &mask, 0 );
@@ -912,25 +891,25 @@ static void adapters_addresses_copy( IP_ADAPTER_ADDRESSES *dst, IP_ADAPTER_ADDRE
static BOOL sockaddr_is_loopback( SOCKADDR *sock )
{
- if (sock->sa_family == WS_AF_INET)
+ if (sock->sa_family == AF_INET)
{
SOCKADDR_IN *sin = (SOCKADDR_IN *)sock;
- return (sin->sin_addr.WS_s_addr & 0xff) == 127;
+ return (sin->sin_addr.s_addr & 0xff) == 127;
}
- else if (sock->sa_family == WS_AF_INET6)
+ else if (sock->sa_family == AF_INET6)
{
SOCKADDR_IN6 *sin6 = (SOCKADDR_IN6 *)sock;
- return WS_IN6_IS_ADDR_LOOPBACK( &sin6->sin6_addr );
+ return IN6_IS_ADDR_LOOPBACK( &sin6->sin6_addr );
}
return FALSE;
}
static BOOL sockaddr_is_linklocal( SOCKADDR *sock )
{
- if (sock->sa_family == WS_AF_INET6)
+ if (sock->sa_family == AF_INET6)
{
SOCKADDR_IN6 *sin6 = (SOCKADDR_IN6 *)sock;
- return WS_IN6_IS_ADDR_LINKLOCAL( &sin6->sin6_addr );
+ return IN6_IS_ADDR_LINKLOCAL( &sin6->sin6_addr );
}
return FALSE;
}
@@ -949,8 +928,8 @@ static DWORD unicast_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG family, UL
struct nsi_ip_unicast_dynamic *dyn;
struct nsi_ip_unicast_static *stat;
IP_ADAPTER_UNICAST_ADDRESS *addr, **next;
- DWORD err, count, i, key_size = (family == WS_AF_INET) ? sizeof(*key4) : sizeof(*key6);
- DWORD sockaddr_size = (family == WS_AF_INET) ? sizeof(SOCKADDR_IN) : sizeof(SOCKADDR_IN6);
+ DWORD err, count, i, key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6);
+ DWORD sockaddr_size = (family == AF_INET) ? sizeof(SOCKADDR_IN) : sizeof(SOCKADDR_IN6);
NET_LUID *luid;
void *key;
@@ -969,7 +948,7 @@ static DWORD unicast_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG family, UL
{
key4 = (struct nsi_ipv4_unicast_key *)key + i;
key6 = (struct nsi_ipv6_unicast_key *)key + i;
- luid = (family == WS_AF_INET) ? &key4->luid : &key6->luid;
+ luid = (family == AF_INET) ? &key4->luid : &key6->luid;
if (luid->Value != aa->Luid.Value) continue;
addr = heap_alloc_zero( sizeof(*addr) + sockaddr_size );
if (!addr)
@@ -981,7 +960,7 @@ static DWORD unicast_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG family, UL
addr->Address.lpSockaddr = (SOCKADDR *)(addr + 1);
addr->Address.iSockaddrLength = sockaddr_size;
addr->Address.lpSockaddr->sa_family = family;
- if (family == WS_AF_INET)
+ if (family == AF_INET)
{
SOCKADDR_IN *in = (SOCKADDR_IN *)addr->Address.lpSockaddr;
in->sin_addr = key4->addr;
@@ -1018,8 +997,8 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
struct nsi_ipv6_forward_key *key6;
IP_ADAPTER_GATEWAY_ADDRESS *gw, **gw_next;
IP_ADAPTER_PREFIX *prefix, **prefix_next;
- DWORD err, count, i, prefix_len, key_size = (family == WS_AF_INET) ? sizeof(*key4) : sizeof(*key6);
- DWORD sockaddr_size = (family == WS_AF_INET) ? sizeof(SOCKADDR_IN) : sizeof(SOCKADDR_IN6);
+ DWORD err, count, i, prefix_len, key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6);
+ DWORD sockaddr_size = (family == AF_INET) ? sizeof(SOCKADDR_IN) : sizeof(SOCKADDR_IN6);
SOCKADDR_INET sockaddr;
NET_LUID *luid;
void *key;
@@ -1039,15 +1018,15 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
{
key4 = (struct nsi_ipv4_forward_key *)key + i;
key6 = (struct nsi_ipv6_forward_key *)key + i;
- luid = (family == WS_AF_INET) ? &key4->luid : &key6->luid;
+ luid = (family == AF_INET) ? &key4->luid : &key6->luid;
if (luid->Value != aa->Luid.Value) continue;
if (flags & GAA_FLAG_INCLUDE_ALL_GATEWAYS)
{
memset( &sockaddr, 0, sizeof(sockaddr) );
- if (family == WS_AF_INET)
+ if (family == AF_INET)
{
- if (key4->next_hop.WS_s_addr != 0)
+ if (key4->next_hop.s_addr != 0)
{
sockaddr.si_family = family;
sockaddr.Ipv4.sin_addr = key4->next_hop;
@@ -1083,9 +1062,9 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
if (flags & GAA_FLAG_INCLUDE_PREFIX)
{
memset( &sockaddr, 0, sizeof(sockaddr) );
- if (family == WS_AF_INET)
+ if (family == AF_INET)
{
- if (!key4->next_hop.WS_s_addr)
+ if (!key4->next_hop.s_addr)
{
sockaddr.si_family = family;
sockaddr.Ipv4.sin_addr = key4->prefix;
@@ -1134,15 +1113,15 @@ static DWORD call_families( DWORD (*fn)( IP_ADAPTER_ADDRESSES *aa, ULONG family,
{
DWORD err;
- if (family != WS_AF_INET)
+ if (family != AF_INET)
{
- err = fn( aa, WS_AF_INET6, flags );
+ err = fn( aa, AF_INET6, flags );
if (err) return err;
}
- if (family != WS_AF_INET6)
+ if (family != AF_INET6)
{
- err = fn( aa, WS_AF_INET, flags );
+ err = fn( aa, AF_INET, flags );
if (err) return err;
}
return err;
@@ -1150,8 +1129,8 @@ static DWORD call_families( DWORD (*fn)( IP_ADAPTER_ADDRESSES *aa, ULONG family,
static DWORD dns_servers_query_code( ULONG family )
{
- if (family == WS_AF_INET) return DnsConfigDnsServersIpv4;
- if (family == WS_AF_INET6) return DnsConfigDnsServersIpv6;
+ if (family == AF_INET) return DnsConfigDnsServersIpv4;
+ if (family == AF_INET6) return DnsConfigDnsServersIpv6;
return DnsConfigDnsServersUnspec;
}
@@ -1351,11 +1330,11 @@ ULONG WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses( ULONG family, ULONG flags,
*/
DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
{
- struct WS_sockaddr_in sa_in;
+ struct sockaddr_in sa_in;
memset(&sa_in, 0, sizeof(sa_in));
- sa_in.sin_family = WS_AF_INET;
+ sa_in.sin_family = AF_INET;
sa_in.sin_addr.S_un.S_addr = dwDestAddr;
- return GetBestInterfaceEx((struct WS_sockaddr *)&sa_in, pdwBestIfIndex);
+ return GetBestInterfaceEx((struct sockaddr *)&sa_in, pdwBestIfIndex);
}
/******************************************************************
@@ -1371,7 +1350,7 @@ DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
* Success: NO_ERROR
* Failure: error code from winerror.h
*/
-DWORD WINAPI GetBestInterfaceEx(struct WS_sockaddr *pDestAddr, PDWORD pdwBestIfIndex)
+DWORD WINAPI GetBestInterfaceEx(struct sockaddr *pDestAddr, PDWORD pdwBestIfIndex)
{
DWORD ret;
@@ -1381,8 +1360,8 @@ DWORD WINAPI GetBestInterfaceEx(struct WS_sockaddr *pDestAddr, PDWORD pdwBestIfI
else {
MIB_IPFORWARDROW ipRow;
- if (pDestAddr->sa_family == WS_AF_INET) {
- ret = GetBestRoute(((struct WS_sockaddr_in *)pDestAddr)->sin_addr.S_un.S_addr, 0, &ipRow);
+ if (pDestAddr->sa_family == AF_INET) {
+ ret = GetBestRoute(((struct sockaddr_in *)pDestAddr)->sin_addr.S_un.S_addr, 0, &ipRow);
if (ret == ERROR_SUCCESS)
*pdwBestIfIndex = ipRow.dwForwardIfIndex;
} else {
@@ -1510,7 +1489,7 @@ static void icmp_stats_ex_to_icmp_stats( MIBICMPSTATS_EX *stats_ex, MIBICMPSTATS
DWORD WINAPI GetIcmpStatistics( MIB_ICMP *stats )
{
MIB_ICMP_EX stats_ex;
- DWORD err = GetIcmpStatisticsEx( &stats_ex, WS_AF_INET );
+ DWORD err = GetIcmpStatisticsEx( &stats_ex, AF_INET );
if (err) return err;
@@ -1999,7 +1978,7 @@ DWORD WINAPI GetIpAddrTable( MIB_IPADDRTABLE *table, ULONG *size, BOOL sort )
if (!!loopback != (keys[i].luid.Info.IfType == MIB_IF_TYPE_LOOPBACK)) continue;
- row->dwAddr = keys[i].addr.WS_s_addr;
+ row->dwAddr = keys[i].addr.s_addr;
ConvertInterfaceLuidToIndex( &keys[i].luid, &row->dwIndex );
ConvertLengthToIpv4Mask( rw[i].on_link_prefix, &row->dwMask );
row->dwBCastAddr = 1;
@@ -2113,10 +2092,10 @@ DWORD WINAPI GetIpForwardTable( MIB_IPFORWARDTABLE *table, ULONG *size, BOOL sor
{
MIB_IPFORWARDROW *row = table->table + i;
- row->dwForwardDest = keys[i].prefix.WS_s_addr;
+ row->dwForwardDest = keys[i].prefix.s_addr;
ConvertLengthToIpv4Mask( keys[i].prefix_len, &row->dwForwardMask );
row->dwForwardPolicy = 0;
- row->dwForwardNextHop = keys[i].next_hop.WS_s_addr;
+ row->dwForwardNextHop = keys[i].next_hop.s_addr;
row->u1.dwForwardType = row->dwForwardNextHop ? MIB_IPROUTE_TYPE_INDIRECT : MIB_IPROUTE_TYPE_DIRECT;
if (!row->dwForwardNextHop) /* find the interface's addr */
{
@@ -2124,7 +2103,7 @@ DWORD WINAPI GetIpForwardTable( MIB_IPFORWARDTABLE *table, ULONG *size, BOOL sor
{
if (uni_keys[addr].luid.Value == keys[i].luid.Value)
{
- row->dwForwardNextHop = uni_keys[addr].addr.WS_s_addr;
+ row->dwForwardNextHop = uni_keys[addr].addr.s_addr;
break;
}
}
@@ -2193,7 +2172,7 @@ static void forward_row2_fill( MIB_IPFORWARD_ROW2 *row, USHORT fam, void *key, s
struct nsi_ipv4_forward_dynamic *dyn4 = (struct nsi_ipv4_forward_dynamic *)dyn;
struct nsi_ipv6_forward_dynamic *dyn6 = (struct nsi_ipv6_forward_dynamic *)dyn;
- if (fam == WS_AF_INET)
+ if (fam == AF_INET)
{
row->InterfaceLuid = key4->luid;
row->DestinationPrefix.Prefix.Ipv4.sin_family = fam;
@@ -2251,19 +2230,19 @@ DWORD WINAPI GetIpForwardTable2( ADDRESS_FAMILY family, MIB_IPFORWARD_TABLE2 **t
struct nsi_ip_forward_rw *rw[2] = { NULL, NULL };
void *dyn[2] = { NULL, NULL };
struct nsi_ip_forward_static *stat[2] = { NULL, NULL };
- static const USHORT fam[2] = { WS_AF_INET, WS_AF_INET6 };
+ static const USHORT fam[2] = { AF_INET, AF_INET6 };
static const DWORD key_size[2] = { sizeof(struct nsi_ipv4_forward_key), sizeof(struct nsi_ipv6_forward_key) };
static const DWORD dyn_size[2] = { sizeof(struct nsi_ipv4_forward_dynamic), sizeof(struct nsi_ipv6_forward_dynamic) };
DWORD err = ERROR_SUCCESS, i, size, count[2] = { 0, 0 };
TRACE( "%u, %p\n", family, table );
- if (!table || (family != WS_AF_INET && family != WS_AF_INET6 && family != WS_AF_UNSPEC))
+ if (!table || (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC))
return ERROR_INVALID_PARAMETER;
for (i = 0; i < 2; i++)
{
- if (family != WS_AF_UNSPEC && family != fam[i]) continue;
+ if (family != AF_UNSPEC && family != fam[i]) continue;
err = NsiAllocateAndGetTable( 1, ip_module_id( fam[i] ), NSI_IP_FORWARD_TABLE, key + i, key_size[i],
(void **)rw + i, sizeof(**rw), dyn + i, dyn_size[i],
@@ -2362,7 +2341,7 @@ DWORD WINAPI GetIpNetTable( MIB_IPNETTABLE *table, ULONG *size, BOOL sort )
memcpy( row->bPhysAddr, rw[i].phys_addr, row->dwPhysAddrLen );
memset( row->bPhysAddr + row->dwPhysAddrLen, 0,
sizeof(row->bPhysAddr) - row->dwPhysAddrLen );
- row->dwAddr = keys[i].addr.WS_s_addr;
+ row->dwAddr = keys[i].addr.s_addr;
switch (dyn->state)
{
case NlnsUnreachable:
@@ -2419,7 +2398,7 @@ static void ipnet_row2_fill( MIB_IPNET_ROW2 *row, USHORT fam, void *key, struct
struct nsi_ipv4_neighbour_key *key4 = (struct nsi_ipv4_neighbour_key *)key;
struct nsi_ipv6_neighbour_key *key6 = (struct nsi_ipv6_neighbour_key *)key;
- if (fam == WS_AF_INET)
+ if (fam == AF_INET)
{
row->Address.Ipv4.sin_family = fam;
row->Address.Ipv4.sin_port = 0;
@@ -2460,18 +2439,18 @@ DWORD WINAPI GetIpNetTable2( ADDRESS_FAMILY family, MIB_IPNET_TABLE2 **table )
void *key[2] = { NULL, NULL };
struct nsi_ip_neighbour_rw *rw[2] = { NULL, NULL };
struct nsi_ip_neighbour_dynamic *dyn[2] = { NULL, NULL };
- static const USHORT fam[2] = { WS_AF_INET, WS_AF_INET6 };
+ static const USHORT fam[2] = { AF_INET, AF_INET6 };
static const DWORD key_size[2] = { sizeof(struct nsi_ipv4_neighbour_key), sizeof(struct nsi_ipv6_neighbour_key) };
DWORD err = ERROR_SUCCESS, i, size, count[2] = { 0, 0 };
TRACE( "%u, %p\n", family, table );
- if (!table || (family != WS_AF_INET && family != WS_AF_INET6 && family != WS_AF_UNSPEC))
+ if (!table || (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC))
return ERROR_INVALID_PARAMETER;
for (i = 0; i < 2; i++)
{
- if (family != WS_AF_UNSPEC && family != fam[i]) continue;
+ if (family != AF_UNSPEC && family != fam[i]) continue;
err = NsiAllocateAndGetTable( 1, ip_module_id( fam[i] ), NSI_IP_NEIGHBOUR_TABLE, key + i, key_size[i],
(void **)rw + i, sizeof(**rw), (void **)dyn + i, sizeof(**dyn),
@@ -2523,7 +2502,7 @@ err:
*/
DWORD WINAPI GetIpStatistics( MIB_IPSTATS *stats )
{
- return GetIpStatisticsEx( stats, WS_AF_INET );
+ return GetIpStatisticsEx( stats, AF_INET );
}
/******************************************************************
@@ -2817,7 +2796,7 @@ BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHo
*/
DWORD WINAPI GetTcpStatistics( MIB_TCPSTATS *stats )
{
- return GetTcpStatisticsEx( stats, WS_AF_INET );
+ return GetTcpStatisticsEx( stats, AF_INET );
}
/******************************************************************
@@ -2901,27 +2880,27 @@ static DWORD tcp_table_size( ULONG family, ULONG table_class, DWORD row_count, D
case TCP_TABLE_BASIC_LISTENER:
case TCP_TABLE_BASIC_CONNECTIONS:
case TCP_TABLE_BASIC_ALL:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_TCPROW) : sizeof(MIB_TCP6ROW);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_TCPROW) : sizeof(MIB_TCP6ROW);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE, table[row_count]) :
FIELD_OFFSET(MIB_TCP6TABLE, table[row_count]);
case TCP_TABLE_OWNER_PID_LISTENER:
case TCP_TABLE_OWNER_PID_CONNECTIONS:
case TCP_TABLE_OWNER_PID_ALL:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_TCPROW_OWNER_PID) : sizeof(MIB_TCP6ROW_OWNER_PID);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE_OWNER_PID, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_TCPROW_OWNER_PID) : sizeof(MIB_TCP6ROW_OWNER_PID);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE_OWNER_PID, table[row_count]) :
FIELD_OFFSET(MIB_TCP6TABLE_OWNER_PID, table[row_count]);
case TCP_TABLE_OWNER_MODULE_LISTENER:
case TCP_TABLE_OWNER_MODULE_CONNECTIONS:
case TCP_TABLE_OWNER_MODULE_ALL:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_TCPROW_OWNER_MODULE) : sizeof(MIB_TCP6ROW_OWNER_MODULE);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE_OWNER_MODULE, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_TCPROW_OWNER_MODULE) : sizeof(MIB_TCP6ROW_OWNER_MODULE);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE_OWNER_MODULE, table[row_count]) :
FIELD_OFFSET(MIB_TCP6TABLE_OWNER_MODULE, table[row_count]);
case TCP_TABLE2:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_TCPROW2) : sizeof(MIB_TCP6ROW2);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE2, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_TCPROW2) : sizeof(MIB_TCP6ROW2);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE2, table[row_count]) :
FIELD_OFFSET(MIB_TCP6TABLE2, table[row_count]);
default:
@@ -2934,7 +2913,7 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
struct nsi_tcp_conn_key *key, struct nsi_tcp_conn_dynamic *dyn,
struct nsi_tcp_conn_static *stat )
{
- if (family == WS_AF_INET)
+ if (family == AF_INET)
{
switch (table_class)
{
@@ -2944,9 +2923,9 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
{
MIB_TCPROW *row = ((MIB_TCPTABLE *)table)->table + num;
row->u.dwState = dyn->state;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
- row->dwRemoteAddr = key->remote.Ipv4.sin_addr.WS_s_addr;
+ row->dwRemoteAddr = key->remote.Ipv4.sin_addr.s_addr;
row->dwRemotePort = key->remote.Ipv4.sin_port;
return;
}
@@ -2956,9 +2935,9 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
{
MIB_TCPROW_OWNER_PID *row = ((MIB_TCPTABLE_OWNER_PID *)table)->table + num;
row->dwState = dyn->state;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
- row->dwRemoteAddr = key->remote.Ipv4.sin_addr.WS_s_addr;
+ row->dwRemoteAddr = key->remote.Ipv4.sin_addr.s_addr;
row->dwRemotePort = key->remote.Ipv4.sin_port;
row->dwOwningPid = stat->pid;
return;
@@ -2969,9 +2948,9 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
{
MIB_TCPROW_OWNER_MODULE *row = ((MIB_TCPTABLE_OWNER_MODULE *)table)->table + num;
row->dwState = dyn->state;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
- row->dwRemoteAddr = key->remote.Ipv4.sin_addr.WS_s_addr;
+ row->dwRemoteAddr = key->remote.Ipv4.sin_addr.s_addr;
row->dwRemotePort = key->remote.Ipv4.sin_port;
row->dwOwningPid = stat->pid;
row->liCreateTimestamp.QuadPart = stat->create_time;
@@ -2983,9 +2962,9 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
{
MIB_TCPROW2 *row = ((MIB_TCPTABLE2 *)table)->table + num;
row->dwState = dyn->state;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
- row->dwRemoteAddr = key->remote.Ipv4.sin_addr.WS_s_addr;
+ row->dwRemoteAddr = key->remote.Ipv4.sin_addr.s_addr;
row->dwRemotePort = key->remote.Ipv4.sin_port;
row->dwOwningPid = stat->pid;
row->dwOffloadState = 0; /* FIXME */
@@ -3156,7 +3135,7 @@ static DWORD get_extended_tcp_table( void *table, DWORD *size, BOOL sort, ULONG
int (*fn)(const void *, const void *);
DWORD offset;
- if (family == WS_AF_INET) fn = tcp_row_cmp;
+ if (family == AF_INET) fn = tcp_row_cmp;
else if (row_size == sizeof(MIB_TCP6ROW)) fn = tcp6_row_basic_cmp;
else fn = tcp6_row_owner_cmp;
@@ -3206,7 +3185,7 @@ DWORD WINAPI GetExtendedTcpTable( void *table, DWORD *size, BOOL sort, ULONG fam
DWORD WINAPI GetTcpTable( MIB_TCPTABLE *table, DWORD *size, BOOL sort )
{
TRACE( "table %p, size %p, sort %d\n", table, size, sort );
- return get_extended_tcp_table( table, size, sort, WS_AF_INET, TCP_TABLE_BASIC_ALL );
+ return get_extended_tcp_table( table, size, sort, AF_INET, TCP_TABLE_BASIC_ALL );
}
/******************************************************************
@@ -3215,7 +3194,7 @@ DWORD WINAPI GetTcpTable( MIB_TCPTABLE *table, DWORD *size, BOOL sort )
ULONG WINAPI GetTcp6Table( MIB_TCP6TABLE *table, ULONG *size, BOOL sort )
{
TRACE( "table %p, size %p, sort %d\n", table, size, sort );
- return get_extended_tcp_table( table, size, sort, WS_AF_INET6, TCP_TABLE_BASIC_ALL );
+ return get_extended_tcp_table( table, size, sort, AF_INET6, TCP_TABLE_BASIC_ALL );
}
/******************************************************************
@@ -3224,7 +3203,7 @@ ULONG WINAPI GetTcp6Table( MIB_TCP6TABLE *table, ULONG *size, BOOL sort )
ULONG WINAPI GetTcpTable2( MIB_TCPTABLE2 *table, ULONG *size, BOOL sort )
{
TRACE( "table %p, size %p, sort %d\n", table, size, sort );
- return get_extended_tcp_table( table, size, sort, WS_AF_INET, TCP_TABLE2 );
+ return get_extended_tcp_table( table, size, sort, AF_INET, TCP_TABLE2 );
}
/******************************************************************
@@ -3233,7 +3212,7 @@ ULONG WINAPI GetTcpTable2( MIB_TCPTABLE2 *table, ULONG *size, BOOL sort )
ULONG WINAPI GetTcp6Table2( MIB_TCP6TABLE2 *table, ULONG *size, BOOL sort )
{
TRACE( "table %p, size %p, sort %d\n", table, size, sort );
- return get_extended_tcp_table( table, size, sort, WS_AF_INET6, TCP_TABLE2 );
+ return get_extended_tcp_table( table, size, sort, AF_INET6, TCP_TABLE2 );
}
static DWORD allocate_tcp_table( void **table, BOOL sort, HANDLE heap, DWORD flags,
@@ -3263,7 +3242,7 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( MIB_TCPTABLE **table, BOOL sort, H
if (!table) return ERROR_INVALID_PARAMETER;
- return allocate_tcp_table( (void **)table, sort, heap, flags, WS_AF_INET, TCP_TABLE_BASIC_ALL );
+ return allocate_tcp_table( (void **)table, sort, heap, flags, AF_INET, TCP_TABLE_BASIC_ALL );
}
/******************************************************************
@@ -3274,7 +3253,7 @@ DWORD WINAPI AllocateAndGetTcpExTableFromStack( void **table, BOOL sort, HANDLE
TRACE( "table %p, sort %d, heap %p, flags 0x%08x, family %u\n", table, sort, heap, flags, family );
if (!table || !ip_module_id( family )) return ERROR_INVALID_PARAMETER;
- if (family == WS_AF_INET6) return ERROR_NOT_SUPPORTED;
+ if (family == AF_INET6) return ERROR_NOT_SUPPORTED;
return allocate_tcp_table( table, sort, heap, flags, family, TCP_TABLE_OWNER_PID_ALL );
}
@@ -3289,7 +3268,7 @@ DWORD WINAPI AllocateAndGetTcpExTableFromStack( void **table, BOOL sort, HANDLE
*/
DWORD WINAPI GetUdpStatistics( MIB_UDPSTATS *stats )
{
- return GetUdpStatisticsEx( stats, WS_AF_INET );
+ return GetUdpStatisticsEx( stats, AF_INET );
}
/******************************************************************
@@ -3339,7 +3318,7 @@ DWORD WINAPI GetUdpStatisticsEx( MIB_UDPSTATS *stats, DWORD family )
*/
DWORD WINAPI GetUdpTable( MIB_UDPTABLE *table, DWORD *size, BOOL sort )
{
- return GetExtendedUdpTable( table, size, sort, WS_AF_INET, UDP_TABLE_BASIC, 0 );
+ return GetExtendedUdpTable( table, size, sort, AF_INET, UDP_TABLE_BASIC, 0 );
}
/******************************************************************
@@ -3347,7 +3326,7 @@ DWORD WINAPI GetUdpTable( MIB_UDPTABLE *table, DWORD *size, BOOL sort )
*/
DWORD WINAPI GetUdp6Table( MIB_UDP6TABLE *table, DWORD *size, BOOL sort )
{
- return GetExtendedUdpTable( table, size, sort, WS_AF_INET6, UDP_TABLE_BASIC, 0 );
+ return GetExtendedUdpTable( table, size, sort, AF_INET6, UDP_TABLE_BASIC, 0 );
}
static DWORD udp_table_size( ULONG family, ULONG table_class, DWORD row_count, DWORD *row_size )
@@ -3355,18 +3334,18 @@ static DWORD udp_table_size( ULONG family, ULONG table_class, DWORD row_count, D
switch (table_class)
{
case UDP_TABLE_BASIC:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_UDPROW) : sizeof(MIB_UDP6ROW);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_UDPROW) : sizeof(MIB_UDP6ROW);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE, table[row_count]) :
FIELD_OFFSET(MIB_UDP6TABLE, table[row_count]);
case UDP_TABLE_OWNER_PID:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_UDPROW_OWNER_PID) : sizeof(MIB_UDP6ROW_OWNER_PID);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE_OWNER_PID, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_UDPROW_OWNER_PID) : sizeof(MIB_UDP6ROW_OWNER_PID);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE_OWNER_PID, table[row_count]) :
FIELD_OFFSET(MIB_UDP6TABLE_OWNER_PID, table[row_count]);
case UDP_TABLE_OWNER_MODULE:
- *row_size = (family == WS_AF_INET) ? sizeof(MIB_UDPROW_OWNER_MODULE) : sizeof(MIB_UDP6ROW_OWNER_MODULE);
- return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE_OWNER_MODULE, table[row_count]) :
+ *row_size = (family == AF_INET) ? sizeof(MIB_UDPROW_OWNER_MODULE) : sizeof(MIB_UDP6ROW_OWNER_MODULE);
+ return (family == AF_INET) ? FIELD_OFFSET(MIB_UDPTABLE_OWNER_MODULE, table[row_count]) :
FIELD_OFFSET(MIB_UDP6TABLE_OWNER_MODULE, table[row_count]);
default:
@@ -3379,21 +3358,21 @@ static void udp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
struct nsi_udp_endpoint_key *key,
struct nsi_udp_endpoint_static *stat )
{
- if (family == WS_AF_INET)
+ if (family == AF_INET)
{
switch (table_class)
{
case UDP_TABLE_BASIC:
{
MIB_UDPROW *row = ((MIB_UDPTABLE *)table)->table + num;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
return;
}
case UDP_TABLE_OWNER_PID:
{
MIB_UDPROW_OWNER_PID *row = ((MIB_UDPTABLE_OWNER_PID *)table)->table + num;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
row->dwOwningPid = stat->pid;
return;
@@ -3401,7 +3380,7 @@ static void udp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas
case UDP_TABLE_OWNER_MODULE:
{
MIB_UDPROW_OWNER_MODULE *row = ((MIB_UDPTABLE_OWNER_MODULE *)table)->table + num;
- row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr;
+ row->dwLocalAddr = key->local.Ipv4.sin_addr.s_addr;
row->dwLocalPort = key->local.Ipv4.sin_port;
row->dwOwningPid = stat->pid;
row->liCreateTimestamp.QuadPart = stat->create_time;
@@ -3525,7 +3504,7 @@ DWORD WINAPI GetExtendedUdpTable( void *table, DWORD *size, BOOL sort, ULONG fam
int (*fn)(const void *, const void *);
DWORD offset = udp_table_size( family, table_class, 0, &row_size );
- if (family == WS_AF_INET) fn = udp_row_cmp;
+ if (family == AF_INET) fn = udp_row_cmp;
else fn = udp6_row_cmp;
qsort( (BYTE *)table + offset, num, row_size, fn );
@@ -3547,7 +3526,7 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack( MIB_UDPTABLE **table, BOOL sort, H
{
*table = HeapAlloc( heap, flags, size );
if (!*table) return ERROR_NOT_ENOUGH_MEMORY;
- err = GetExtendedUdpTable( *table, &size, sort, WS_AF_INET, UDP_TABLE_BASIC, 0 );
+ err = GetExtendedUdpTable( *table, &size, sort, AF_INET, UDP_TABLE_BASIC, 0 );
if (!err) break;
HeapFree( heap, flags, *table );
*table = NULL;
@@ -3562,7 +3541,7 @@ static void unicast_row_fill( MIB_UNICASTIPADDRESS_ROW *row, USHORT fam, void *k
struct nsi_ipv4_unicast_key *key4 = (struct nsi_ipv4_unicast_key *)key;
struct nsi_ipv6_unicast_key *key6 = (struct nsi_ipv6_unicast_key *)key;
- if (fam == WS_AF_INET)
+ if (fam == AF_INET)
{
row->Address.Ipv4.sin_family = fam;
row->Address.Ipv4.sin_port = 0;
@@ -3615,7 +3594,7 @@ DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row)
if (err) return err;
}
- if (row->Address.si_family == WS_AF_INET)
+ if (row->Address.si_family == AF_INET)
{
key4.luid = row->InterfaceLuid;
key4.addr = row->Address.Ipv4.sin_addr;
@@ -3623,7 +3602,7 @@ DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row)
key = &key4;
key_size = sizeof(key4);
}
- else if (row->Address.si_family == WS_AF_INET6)
+ else if (row->Address.si_family == AF_INET6)
{
key6.luid = row->InterfaceLuid;
key6.addr = row->Address.Ipv6.sin6_addr;
@@ -3644,18 +3623,18 @@ DWORD WINAPI GetUnicastIpAddressTable(ADDRESS_FAMILY family, MIB_UNICASTIPADDRES
struct nsi_ip_unicast_rw *rw[2] = { NULL, NULL };
struct nsi_ip_unicast_dynamic *dyn[2] = { NULL, NULL };
struct nsi_ip_unicast_static *stat[2] = { NULL, NULL };
- static const USHORT fam[2] = { WS_AF_INET, WS_AF_INET6 };
+ static const USHORT fam[2] = { AF_INET, AF_INET6 };
static const DWORD key_size[2] = { sizeof(struct nsi_ipv4_unicast_key), sizeof(struct nsi_ipv6_unicast_key) };
DWORD err, i, size, count[2] = { 0, 0 };
TRACE( "%u, %p\n", family, table );
- if (!table || (family != WS_AF_INET && family != WS_AF_INET6 && family != WS_AF_UNSPEC))
+ if (!table || (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC))
return ERROR_INVALID_PARAMETER;
for (i = 0; i < 2; i++)
{
- if (family != WS_AF_UNSPEC && family != fam[i]) continue;
+ if (family != AF_UNSPEC && family != fam[i]) continue;
err = NsiAllocateAndGetTable( 1, ip_module_id( fam[i] ), NSI_IP_UNICAST_TABLE, key + i, key_size[i],
(void **)rw + i, sizeof(**rw), (void **)dyn + i, sizeof(**dyn),
--
2.25.1
1
0
Oct. 6, 2021
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
We are going to implement more accurate checks in SetParameters and
these calls seem to be required in order to start an effect.
dlls/joy.cpl/main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c
index 57c188a5df1..3c9949b7ef3 100644
--- a/dlls/joy.cpl/main.c
+++ b/dlls/joy.cpl/main.c
@@ -726,6 +726,9 @@ static void ff_handle_effectchange(HWND hwnd, struct Joystick *joy)
if (sel < 0) return;
joy->chosen_effect = sel;
+ IDirectInputDevice8_Unacquire(joy->device);
+ IDirectInputDevice8_SetCooperativeLevel(joy->device, GetAncestor(hwnd, GA_ROOT), DISCL_BACKGROUND|DISCL_EXCLUSIVE);
+ IDirectInputDevice8_Acquire(joy->device);
}
static DWORD WINAPI ff_input_thread(void *param)
--
2.33.0
1
1
Oct. 6, 2021
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51784
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
The first two patches aren't really solving the mentionned bug but they
should help. At least they prevent this series from overflowing.
dlls/dinput8/tests/hid.c | 498 +++++++++++++++++++--------------------
1 file changed, 249 insertions(+), 249 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index f4e180a85f3..466331b326b 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3735,7 +3735,7 @@ static void test_simple_joystick(void)
}
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES );
- ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr );
+ ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr );
if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product ))
{
win_skip( "device not found, skipping tests\n" );
@@ -3755,62 +3755,62 @@ static void test_simple_joystick(void)
check_member( devinst, expect_devinst, "%04x", wUsage );
hr = IDirectInput8_CreateDevice( di, &devinst.guidInstance, NULL, NULL );
- ok( hr == E_POINTER, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == E_POINTER, "CreateDevice returned %#x\n", hr );
hr = IDirectInput8_CreateDevice( di, NULL, &device, NULL );
- ok( hr == E_POINTER, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == E_POINTER, "CreateDevice returned %#x\n", hr );
hr = IDirectInput8_CreateDevice( di, &GUID_NULL, &device, NULL );
- ok( hr == DIERR_DEVICENOTREG, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == DIERR_DEVICENOTREG, "CreateDevice returned %#x\n", hr );
hr = IDirectInput8_CreateDevice( di, &devinst.guidInstance, &device, NULL );
- ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_VIDPID returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
/* Wine may get the wrong device here, because the test driver creates another instance of
hidclass.sys, and gets duplicate rawinput handles, which we use in the guidInstance */
todo_wine_if( prop_dword.dwData != EXPECT_VIDPID )
ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
ref = IDirectInputDevice8_Release( device );
- ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL );
- ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, 0x0700, &GUID_NULL );
todo_wine
- ok( hr == DIERR_BETADIRECTINPUTVERSION, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, NULL );
todo_wine
- ok( hr == E_POINTER, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == E_POINTER, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, NULL, DIRECTINPUT_VERSION, &GUID_NULL );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &GUID_NULL );
todo_wine
- ok( hr == REGDB_E_CLASSNOTREG, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == REGDB_E_CLASSNOTREG, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidInstance );
- ok( hr == DI_OK, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == DI_OK, "Initialize returned %#x\n", hr );
guid = devinst.guidInstance;
memset( &devinst, 0, sizeof(devinst) );
devinst.dwSize = sizeof(DIDEVICEINSTANCEW);
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
ok( IsEqualGUID( &guid, &devinst.guidInstance ), "got %s expected %s\n", debugstr_guid( &guid ),
debugstr_guid( &devinst.guidInstance ) );
hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidProduct );
- ok( hr == DI_OK, "IDirectInputDevice8_Initialize returned %#x\n", hr );
+ ok( hr == DI_OK, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == E_POINTER, "GetDeviceInfo returned %#x\n", hr );
devinst.dwSize = sizeof(DIDEVICEINSTANCEW) + 1;
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetDeviceInfo returned %#x\n", hr );
devinst.dwSize = sizeof(DIDEVICEINSTANCE_DX3W);
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
check_member_guid( devinst, expect_devinst, guidProduct );
@@ -3823,7 +3823,7 @@ static void test_simple_joystick(void)
memset( &devinst, 0, sizeof(devinst) );
devinst.dwSize = sizeof(DIDEVICEINSTANCEW);
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
check_member( devinst, expect_devinst, "%d", dwSize );
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
@@ -3838,13 +3838,13 @@ static void test_simple_joystick(void)
check_member( devinst, expect_devinst, "%04x", wUsage );
hr = IDirectInputDevice8_GetCapabilities( device, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr );
+ ok( hr == E_POINTER, "GetCapabilities returned %#x\n", hr );
hr = IDirectInputDevice8_GetCapabilities( device, &caps );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetCapabilities returned %#x\n", hr );
caps.dwSize = sizeof(DIDEVCAPS);
hr = IDirectInputDevice8_GetCapabilities( device, &caps );
- ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr );
+ ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr );
check_member( caps, expect_caps, "%d", dwSize );
check_member( caps, expect_caps, "%#x", dwFlags );
check_member( caps, expect_caps, "%#x", dwDevType );
@@ -3858,25 +3858,25 @@ static void test_simple_joystick(void)
check_member( caps, expect_caps, "%d", dwFFDriverVersion );
hr = IDirectInputDevice8_GetProperty( device, NULL, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, &GUID_NULL, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER) - 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER);
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_VIDPID returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
todo_wine
ok( IsEqualGUID( &prop_guid_path.guidClass, &GUID_DEVCLASS_HIDCLASS ), "got guid %s\n",
debugstr_guid( &prop_guid_path.guidClass ) );
@@ -3892,77 +3892,77 @@ static void test_simple_joystick(void)
}
hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
todo_wine
ok( !wcscmp( prop_string.wsz, expect_devinst.tszInstanceName ), "got instance %s\n",
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
todo_wine
ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n",
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
todo_wine
ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == S_FALSE, "IDirectInputDevice8_GetProperty DIPROP_USERNAME returned %#x\n", hr );
+ ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr );
todo_wine
ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
todo_wine
ok( prop_dword.dwData == 0, "got %#x expected %#x\n", prop_dword.dwData, 0 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_AXISMODE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_AXISMODE returned %#x\n", hr );
todo_wine
ok( prop_dword.dwData == DIPROPAXISMODE_ABS, "got %u expected %u\n", prop_dword.dwData, DIPROPAXISMODE_ABS );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
ok( prop_dword.dwData == 0, "got %#x expected %#x\n", prop_dword.dwData, 0 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_FFGAIN returned %#x\n", hr );
todo_wine
ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty DIPROP_CALIBRATION returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
ok( prop_dword.dwData == 0, "got %u expected %u\n", prop_dword.dwData, 0 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
ok( prop_dword.dwData == 1, "got %u expected %u\n", prop_dword.dwData, 1 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
prop_range.diph.dwHow = DIPH_BYUSAGE;
@@ -3970,18 +3970,18 @@ static void test_simple_joystick(void)
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr );
ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 );
ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 );
@@ -3989,35 +3989,35 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DIERR_NOTINITIALIZED, "IDirectInputDevice8_GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
hr = IDirectInputDevice8_EnumObjects( device, NULL, NULL, DIDFT_ALL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr );
hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, 0x20 );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr );
res = 0;
hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
ok( res == 5, "got %u expected %u\n", res, 5 );
hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n",
check_objects_params.expect_count - check_objects_params.index );
hr = IDirectInputDevice8_GetObjectInfo( device, NULL, 0, DIPH_DEVICE );
- ok( hr == E_POINTER, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == E_POINTER, "GetObjectInfo returned: %#x\n", hr );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_DEVICE );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetObjectInfo returned: %#x\n", hr );
objinst.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW);
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_DEVICE );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetObjectInfo returned: %#x\n", hr );
res = MAKELONG( HID_USAGE_GENERIC_Z, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
res = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
- ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[1], "%u", dwSize );
check_member_guid( objinst, expect_objects[1], guidType );
@@ -4036,15 +4036,15 @@ static void test_simple_joystick(void)
check_member( objinst, expect_objects[1], "%u", wReportId );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0x14, DIPH_BYOFFSET );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_BYOFFSET );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
res = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 3 );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID );
- ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
res = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 1 );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID );
- ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[5], "%u", dwSize );
check_member_guid( objinst, expect_objects[5], guidType );
@@ -4063,46 +4063,46 @@ static void test_simple_joystick(void)
check_member( objinst, expect_objects[5], "%u", wReportId );
hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumEffects returned %#x\n", hr );
res = 0;
hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
res = 0;
hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, DIEFT_PERIODIC );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
hr = IDirectInputDevice8_EnumEffects( device, check_effects, &check_effects_params, DIEFT_ALL );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n",
check_effects_params.expect_count - check_effects_params.index );
hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine );
- ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
+ ok( hr == E_POINTER, "GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1;
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL );
- ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
+ ok( hr == DIERR_DEVICENOTREG, "GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
- ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
+ ok( hr == DIERR_DEVICENOTREG, "GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == E_POINTER, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
dataformat.dwSize = sizeof(DIDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
dataformat.dwObjSize = sizeof(DIOBJECTDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 );
- ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, DIJOFS_Y, DIPH_BYOFFSET );
- ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[0], "%u", dwSize );
check_member_guid( objinst, expect_objects[0], guidType );
@@ -4122,71 +4122,71 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetEventNotification( device, (HANDLE)0xdeadbeef );
todo_wine
- ok( hr == E_HANDLE, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
+ ok( hr == E_HANDLE, "SetEventNotification returned: %#x\n", hr );
event = CreateEventW( NULL, FALSE, FALSE, NULL );
ok( event != NULL, "CreateEventW failed, last error %u\n", GetLastError() );
hr = IDirectInputDevice8_SetEventNotification( device, event );
- ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetEventNotification returned: %#x\n", hr );
file = CreateFileW( prop_guid_path.wszPath, FILE_READ_ACCESS | FILE_WRITE_ACCESS,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
ok( file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError() );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, 0 );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
- ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
- ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_EXCLUSIVE );
- ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr );
hwnd = CreateWindowW( L"static", L"dinput", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200,
NULL, NULL, NULL, NULL );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_NOEFFECT, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_NOEFFECT, "Unacquire returned: %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE );
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
DestroyWindow( hwnd );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DIERR_NOTACQUIRED, "GetDeviceState returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device );
- ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_Poll returned: %#x\n", hr );
+ ok( hr == DIERR_NOTACQUIRED, "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device );
- ok( hr == DI_NOEFFECT, "IDirectInputDevice8_Poll returned: %#x\n", hr );
+ ok( hr == DI_NOEFFECT, "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2) + 1, &state );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetDeviceState returned: %#x\n", hr );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i)
{
winetest_push_context( "state[%d]", i );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
check_member( state, expect_state[i], "%d", lX );
check_member( state, expect_state[i], "%d", lY );
check_member( state, expect_state[i], "%d", lZ );
@@ -4207,7 +4207,7 @@ static void test_simple_joystick(void)
}
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
winetest_push_context( "state[%d]", i );
check_member( state, expect_state[i], "%d", lX );
check_member( state, expect_state[i], "%d", lY );
@@ -4223,24 +4223,24 @@ static void test_simple_joystick(void)
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA) - 1, objdata, &res, DIGDD_PEEK );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr );
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
- ok( hr == DIERR_NOTBUFFERED, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_NOTBUFFERED, "GetDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 1;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
send_hid_input( file, &injected_input[0], sizeof(*injected_input) );
@@ -4250,23 +4250,23 @@ static void test_simple_joystick(void)
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
- ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 10;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
send_hid_input( file, &injected_input[1], sizeof(*injected_input) );
res = WaitForSingleObject( event, 100 );
@@ -4275,14 +4275,14 @@ static void test_simple_joystick(void)
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
check_member( objdata[0], expect_objdata[0], "%#x", dwOfs );
check_member( objdata[0], expect_objdata[0], "%#x", dwData );
ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
res = 4;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 4, "got %u expected %u\n", res, 4 );
for (i = 0; i < 4; ++i)
{
@@ -4304,7 +4304,7 @@ static void test_simple_joystick(void)
res = 1;
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
- ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
todo_wine
check_member( objdata[0], expect_objdata[5], "%#x", dwOfs );
@@ -4313,7 +4313,7 @@ static void test_simple_joystick(void)
ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
res = ARRAY_SIZE(objdata);
hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 8, "got %u expected %u\n", res, 8 );
for (i = 0; i < 8; ++i)
{
@@ -4332,7 +4332,7 @@ static void test_simple_joystick(void)
ResetEvent( event );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
check_member( state, expect_state[3], "%d", lX );
check_member( state, expect_state[3], "%d", lY );
check_member( state, expect_state[3], "%d", lZ );
@@ -4348,30 +4348,30 @@ static void test_simple_joystick(void)
prop_range.lMin = 1000;
prop_range.lMax = 51000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYUSAGE;
prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_range.lMin = -4000;
prop_range.lMax = -14000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.lMin = -14000;
prop_range.lMax = -4000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_DEVICE;
prop_range.diph.dwObj = 0;
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYUSAGE;
prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr );
ok( prop_range.lMin == -14000, "got %d expected %d\n", prop_range.lMin, -14000 );
ok( prop_range.lMax == -4000, "got %d expected %d\n", prop_range.lMax, -4000 );
prop_range.diph.dwHow = DIPH_BYUSAGE;
@@ -4379,12 +4379,12 @@ static void test_simple_joystick(void)
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr );
ok( prop_range.lMin == 1000, "got %d expected %d\n", prop_range.lMin, 1000 );
ok( prop_range.lMax == 51000, "got %d expected %d\n", prop_range.lMax, 51000 );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
check_member( state, expect_state_abs[1], "%d", lX );
check_member( state, expect_state_abs[1], "%d", lY );
check_member( state, expect_state_abs[1], "%d", lZ );
@@ -4396,118 +4396,118 @@ static void test_simple_joystick(void)
check_member( state, expect_state_abs[1], "%#x", rgbButtons[2] );
hr = IDirectInputDevice8_SetProperty( device, NULL, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, &GUID_NULL, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, NULL );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_VIDPID returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
prop_string.diph.dwHow = DIPH_DEVICE;
prop_string.diph.dwObj = 0;
wcscpy( prop_string.wsz, L"instance name" );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
wcscpy( prop_string.wsz, L"product name" );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
todo_wine
ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n",
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_USERNAME returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_USERNAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_GRANULARITY returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_AXISMODE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 10001;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.dwData = 1000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_DEADZONE returned %#x\n", hr );
prop_dword.dwData = 6000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_dword.dwData = 2000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_DEADZONE returned %#x\n", hr );
ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 );
prop_dword.dwData = 7000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
ok( prop_dword.dwData == 7000, "got %u expected %u\n", prop_dword.dwData, 7000 );
prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_Y, HID_USAGE_PAGE_GENERIC );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
ok( prop_dword.dwData == 1000, "got %u expected %u\n", prop_dword.dwData, 1000 );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
ok( prop_dword.dwData == 6000, "got %u expected %u\n", prop_dword.dwData, 6000 );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i)
{
winetest_push_context( "state[%d]", i );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" );
else
{
@@ -4532,7 +4532,7 @@ static void test_simple_joystick(void)
}
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
winetest_push_context( "state[%d]", i );
check_member( state, expect_state_abs[i], "%d", lX );
check_member( state, expect_state_abs[i], "%d", lY );
@@ -4546,56 +4546,56 @@ static void test_simple_joystick(void)
winetest_pop_context();
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_JOYSTICKID returned %#x\n", hr );
prop_dword.dwData = 0x1000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
prop_dword.dwData = DIPROPAUTOCENTER_ON;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_pointer.uData = 0xfeedcafe;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_AXISMODE returned %#x\n", hr );
prop_dword.dwData = DIPROPAXISMODE_REL;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_AXISMODE returned %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_AXISMODE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_AXISMODE returned %#x\n", hr );
todo_wine
ok( prop_dword.dwData == DIPROPAXISMODE_REL, "got %u expected %u\n", prop_dword.dwData, DIPROPAXISMODE_REL );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr );
ok( prop_dword.dwData == 0x1000, "got %#x expected %#x\n", prop_dword.dwData, 0x1000 );
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
prop_dword.diph.dwHow = DIPH_DEVICE;
@@ -4603,28 +4603,28 @@ static void test_simple_joystick(void)
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 1000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_CALIBRATION returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_CALIBRATION returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_DEADZONE returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i)
{
winetest_push_context( "state[%d]", i );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
todo_wine
check_member( state, expect_state_rel[i], "%d", lX );
todo_wine
@@ -4648,7 +4648,7 @@ static void test_simple_joystick(void)
}
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
winetest_push_context( "state[%d]", i );
todo_wine
check_member( state, expect_state_rel[i], "%d", lX );
@@ -4665,63 +4665,63 @@ static void test_simple_joystick(void)
winetest_pop_context();
hr = IDirectInputDevice8_GetForceFeedbackState( device, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
+ ok( hr == E_POINTER, "GetForceFeedbackState returned %#x\n", hr );
res = 0xdeadbeef;
hr = IDirectInputDevice8_GetForceFeedbackState( device, &res );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "SendForceFeedbackCommand returned %#x\n", hr );
objdata[0].dwOfs = 0xd;
objdata[0].dwData = 0x80;
res = 1;
hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0xdeadbeef );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 1 /*DISDD_CONTINUE*/ );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, NULL, NULL, &effect, NULL );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_NULL, NULL, &effect, NULL );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL );
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, NULL, effect, 0 );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr );
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, effect, 0xdeadbeef );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr );
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, (void *)0xdeadbeef, 0 );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#x\n", hr );
hr = IDirectInputDevice8_Escape( device, NULL );
todo_wine
- ok( hr == E_POINTER, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == E_POINTER, "Escape returned: %#x\n", hr );
hr = IDirectInputDevice8_Escape( device, &escape );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "Escape returned: %#x\n", hr );
escape.dwSize = sizeof(DIEFFESCAPE) + 1;
hr = IDirectInputDevice8_Escape( device, &escape );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "Escape returned: %#x\n", hr );
escape.dwSize = sizeof(DIEFFESCAPE);
escape.dwCommand = 0;
escape.lpvInBuffer = buffer;
@@ -4730,19 +4730,19 @@ static void test_simple_joystick(void)
escape.cbOutBuffer = 10;
hr = IDirectInputDevice8_Escape( device, &escape );
todo_wine
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "Escape returned: %#x\n", hr );
/* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */
Sleep( 100 );
ref = IDirectInputDevice8_Release( device );
- ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
CloseHandle( event );
CloseHandle( file );
ref = IDirectInput8_Release( di );
- ok( ref == 0, "IDirectInput8_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
done:
pnp_driver_stop();
@@ -5030,7 +5030,7 @@ static BOOL test_device_types(void)
}
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES );
- ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr );
+ ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr );
if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product ))
{
win_skip( "device not found, skipping tests\n" );
@@ -5040,10 +5040,10 @@ static BOOL test_device_types(void)
}
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL );
- ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
check_member( devinst, expect_devinst[i], "%d", dwSize );
todo_wine
check_member_guid( devinst, expect_devinst[i], guidInstance );
@@ -5058,7 +5058,7 @@ static BOOL test_device_types(void)
check_member( devinst, expect_devinst[i], "%04x", wUsage );
hr = IDirectInputDevice8_GetCapabilities( device, &caps );
- ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr );
+ ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr );
check_member( caps, expect_caps[i], "%d", dwSize );
check_member( caps, expect_caps[i], "%#x", dwFlags );
check_member( caps, expect_caps[i], "%#x", dwDevType );
@@ -5072,10 +5072,10 @@ static BOOL test_device_types(void)
check_member( caps, expect_caps[i], "%d", dwFFDriverVersion );
ref = IDirectInputDevice8_Release( device );
- ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
ref = IDirectInput8_Release( di );
- ok( ref == 0, "IDirectInput8_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
done:
pnp_driver_stop();
@@ -5095,29 +5095,29 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file )
ULONG ref;
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL );
- ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, NULL, NULL, &effect, NULL );
todo_wine
- ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr );
if (hr == DI_OK) IDirectInputEffect_Release( effect );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_NULL, NULL, &effect, NULL );
todo_wine
- ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DIERR_DEVICENOTREG, "CreateEffect returned %#x\n", hr );
if (hr == DI_OK) IDirectInputEffect_Release( effect );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL );
- ok( hr == DI_OK, "IDirectInputDevice8_CreateEffect returned %#x\n", hr );
+ ok( hr == DI_OK, "CreateEffect returned %#x\n", hr );
if (hr != DI_OK) return;
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, effect, 0xdeadbeef );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr );
check_params.expect_effect = effect;
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_created_effect_objects, &check_params, 0 );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#x\n", hr );
ok( check_params.count == 1, "got count %u, expected 1\n", check_params.count );
ref = IDirectInputEffect_Release( effect );
- ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
}
static void test_force_feedback_joystick( void )
@@ -5664,7 +5664,7 @@ static void test_force_feedback_joystick( void )
}
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES );
- ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr );
+ ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr );
if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product ))
{
win_skip( "device not found, skipping tests\n" );
@@ -5673,10 +5673,10 @@ static void test_force_feedback_joystick( void )
}
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL );
- ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr );
+ ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
- ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
check_member( devinst, expect_devinst, "%d", dwSize );
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
@@ -5692,7 +5692,7 @@ static void test_force_feedback_joystick( void )
caps.dwSize = sizeof(DIDEVCAPS);
hr = IDirectInputDevice8_GetCapabilities( device, &caps );
- ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr );
+ ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr );
check_member( caps, expect_caps, "%d", dwSize );
check_member( caps, expect_caps, "%#x", dwFlags );
check_member( caps, expect_caps, "%#x", dwDevType );
@@ -5708,35 +5708,35 @@ static void test_force_feedback_joystick( void )
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_FFGAIN returned %#x\n", hr );
todo_wine
ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n",
check_objects_params.expect_count - check_objects_params.index );
res = 0;
hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
res = 0;
hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, DIEFT_PERIODIC );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
hr = IDirectInputDevice8_EnumEffects( device, check_effects, &check_effects_params, DIEFT_ALL );
- ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
+ ok( hr == DI_OK, "EnumEffects returned %#x\n", hr );
ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n",
check_effects_params.expect_count - check_effects_params.index );
effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
- ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
+ ok( hr == DI_OK, "GetEffectInfo returned %#x\n", hr );
check_member_guid( effectinfo, expect_effects[0], guid );
check_member( effectinfo, expect_effects[0], "%#x", dwEffType );
check_member( effectinfo, expect_effects[0], "%#x", dwStaticParams );
@@ -5744,10 +5744,10 @@ static void test_force_feedback_joystick( void )
check_member_wstr( effectinfo, expect_effects[0], tszName );
hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 );
- ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
- ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
+ ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
file = CreateFileW( prop_guid_path.wszPath, FILE_READ_ACCESS | FILE_WRITE_ACCESS,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
@@ -5757,33 +5757,33 @@ static void test_force_feedback_joystick( void )
NULL, NULL, NULL, NULL );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 1000;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
todo_wine
- ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr );
+ ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
- ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetForceFeedbackState( device, &res );
todo_wine
- ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
+ ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET );
- ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "SendForceFeedbackCommand returned %#x\n", hr );
escape.dwSize = sizeof(DIEFFESCAPE);
escape.dwCommand = 0;
@@ -5793,75 +5793,75 @@ static void test_force_feedback_joystick( void )
escape.cbOutBuffer = 10;
hr = IDirectInputDevice8_Escape( device, &escape );
todo_wine
- ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Escape returned: %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
- ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
+ ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Acquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
hr = IDirectInputDevice8_Escape( device, &escape );
todo_wine
- ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_Escape returned: %#x\n", hr );
+ ok( hr == DIERR_UNSUPPORTED, "Escape returned: %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
- ok( hr == 0x80040301, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr );
+ ok( hr == 0x80040301, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
res = 0xdeadbeef;
hr = IDirectInputDevice8_GetForceFeedbackState( device, &res );
todo_wine
- ok( hr == 0x80040301, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
+ ok( hr == 0x80040301, "GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef );
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendForceFeedbackCommand returned %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET );
- ok( hr == DI_OK, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == DI_OK, "SendForceFeedbackCommand returned %#x\n", hr );
set_hid_expect( file, NULL, 0 );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_STOPALL );
- ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_PAUSE );
- ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_CONTINUE );
- ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSON );
- ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSOFF );
- ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
+ ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
objdata.dwOfs = 0x1e;
objdata.dwData = 0x80;
res = 1;
hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), &objdata, &res, 0 );
todo_wine
- ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+ ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
test_periodic_effect( device, file );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Unacquire( device );
- ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
+ ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
/* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */
Sleep( 100 );
ref = IDirectInputDevice8_Release( device );
- ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
DestroyWindow( hwnd );
CloseHandle( file );
ref = IDirectInput8_Release( di );
- ok( ref == 0, "IDirectInput8_Release returned %d\n", ref );
+ ok( ref == 0, "Release returned %d\n", ref );
done:
pnp_driver_stop();
--
2.33.0
1
11
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/iphlpapi/iphlpapi_main.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index b2e996a6241..ae356dc7b8c 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -17,19 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-
-#include "config.h"
-
#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
@@ -57,13 +45,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
-#ifndef IF_NAMESIZE
-#define IF_NAMESIZE 16
-#endif
-
#ifndef INADDR_NONE
#define INADDR_NONE ~0UL
#endif
+#define INADDR_ANY 0UL
#define CHARS_IN_GUID 39
--
2.23.0
1
1
[PATCH 01/19] dbghelp: don't expose SymTagExe or SymTagCompiland's address nor length in SymGetTypeInfo()
by Eric Pouech Oct. 6, 2021
by Eric Pouech Oct. 6, 2021
Oct. 6, 2021
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/dbghelp/type.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
index 70719cf6b7c..0baa9d72c32 100644
--- a/dlls/dbghelp/type.c
+++ b/dlls/dbghelp/type.c
@@ -158,11 +158,11 @@ BOOL symt_get_address(const struct symt* type, ULONG64* addr)
case SymTagThunk:
*addr = ((const struct symt_thunk*)type)->address;
break;
- case SymTagCompiland:
- *addr = ((const struct symt_compiland*)type)->address;
- break;
default:
FIXME("Unsupported sym-tag %s for get-address\n", symt_get_tag_str(type->tag));
+ /* fall through */
+ case SymTagExe:
+ case SymTagCompiland:
return FALSE;
}
return TRUE;
@@ -689,6 +689,8 @@ BOOL symt_get_info(struct module* module, const struct symt* type,
FIXME("Unsupported sym-tag %s for get-length\n",
symt_get_tag_str(type->tag));
/* fall through */
+ case SymTagExe:
+ case SymTagCompiland:
case SymTagFunctionType:
return FALSE;
}
1
18
[PATCH 5/5] comctl32/tests: Fix a treeview test failure when theming is on.
by Zhiyi Zhang Oct. 6, 2021
by Zhiyi Zhang Oct. 6, 2021
Oct. 6, 2021
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/treeview.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 02d914c249c..0d245cf9d15 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -27,12 +27,17 @@
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
-#include "commctrl.h"
+#include "commctrl.h"
+#include "uxtheme.h"
+#include "vsstyle.h"
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
+static HTHEME (WINAPI *pGetWindowTheme)(HWND);
+static BOOL (WINAPI *pIsThemeBackgroundPartiallyTransparent)(HTHEME, int, int);
+
static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
static const char *TEST_CALLBACK_TEXT = "callback_text";
@@ -2121,6 +2126,8 @@ static void test_TVS_SINGLEEXPAND(void)
static void test_WM_PAINT(void)
{
+ BOOL is_glyph_transparent;
+ HTHEME htheme;
HWND hTree;
COLORREF clr;
LONG ret;
@@ -2144,7 +2151,11 @@ static void test_WM_PAINT(void)
ok(ret == 0, "got %d\n", ret);
clr = GetPixel(hdc, 1, 1);
- ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */,
+ htheme = pGetWindowTheme(hTree);
+ is_glyph_transparent = htheme && pIsThemeBackgroundPartiallyTransparent(htheme, TVP_GLYPH, 0);
+ ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */
+ /* When theming is on and treeview glyphs are transparent, parent window needs to be repainted */
+ || (is_glyph_transparent && clr == GetSysColor(COLOR_WINDOW)),
"got 0x%x\n", clr);
ReleaseDC(hMainWnd, hdc);
@@ -2945,9 +2956,13 @@ static void test_right_click(void)
static void init_functions(void)
{
HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
+ HMODULE hUxtheme = LoadLibraryA("uxtheme.dll");
-#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
- X(InitCommonControlsEx);
+#define X(module, f) p##f = (void*)GetProcAddress(module, #f);
+ X(hComCtl32, InitCommonControlsEx);
+
+ X(hUxtheme, GetWindowTheme);
+ X(hUxtheme, IsThemeBackgroundPartiallyTransparent);
#undef X
}
--
2.30.2
1
0
[PATCH 4/5] comctl32/status: Do not use theme metrics to compute height.
by Zhiyi Zhang Oct. 6, 2021
by Zhiyi Zhang Oct. 6, 2021
Oct. 6, 2021
Fix status test failures when theming is on.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/status.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c
index 7bc9ec4386f..9078e4a70bc 100644
--- a/dlls/comctl32/status.c
+++ b/dlls/comctl32/status.c
@@ -102,7 +102,6 @@ static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
static UINT
STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
{
- HTHEME theme;
UINT height;
TEXTMETRICW tm;
int margin;
@@ -111,21 +110,6 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
- if ((theme = GetWindowTheme(infoPtr->Self)))
- {
- /* Determine bar height from theme such that the content area is
- * textHeight pixels large */
- HDC hdc = GetDC(infoPtr->Self);
- RECT r;
-
- SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
- if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
- {
- height = r.bottom - r.top;
- }
- ReleaseDC(infoPtr->Self, hdc);
- }
-
TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
return height;
}
--
2.30.2
1
0
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/rebar.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 462782a1b11..d0b201a8763 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -18,11 +18,9 @@
*/
#include <assert.h>
-#include <stdarg.h>
#include <windows.h>
#include <commctrl.h>
-#include <uxtheme.h>
#include "wine/heap.h"
#include "wine/test.h"
--
2.30.2
1
0
Oct. 6, 2021
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/rebar.c | 17 +++----------
dlls/comctl32/tests/rebar.c | 50 +++++++++++++++++++++++++++++--------
2 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 84390bd0b52..6a065514e60 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -2930,14 +2930,9 @@ REBAR_Create (REBAR_INFO *infoPtr, LPCREATESTRUCTW cs)
cs->x, cs->y, cs->cx, cs->cy);
}
+ OpenThemeData(infoPtr->hwndSelf, themeClass);
+
TRACE("created!\n");
-
- if (OpenThemeData (infoPtr->hwndSelf, themeClass))
- {
- /* native seems to clear WS_BORDER when themed */
- infoPtr->dwStyle &= ~WS_BORDER;
- }
-
return 0;
}
@@ -3508,8 +3503,6 @@ REBAR_StyleChanged (REBAR_INFO *infoPtr, INT nType, const STYLESTRUCT *lpStyle)
if (nType == GWL_STYLE)
{
infoPtr->orgStyle = infoPtr->dwStyle = lpStyle->styleNew;
- if (GetWindowTheme (infoPtr->hwndSelf))
- infoPtr->dwStyle &= ~WS_BORDER;
/* maybe it should be COMMON_STYLES like in toolbar */
if ((lpStyle->styleNew ^ lpStyle->styleOld) & CCS_VERT)
REBAR_Layout(infoPtr);
@@ -3522,11 +3515,7 @@ static LRESULT theme_changed (REBAR_INFO* infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme);
- theme = OpenThemeData (infoPtr->hwndSelf, themeClass);
- /* WS_BORDER disappears when theming is enabled and reappears when
- * disabled... */
- infoPtr->dwStyle &= ~WS_BORDER;
- infoPtr->dwStyle |= theme ? 0 : (infoPtr->orgStyle & WS_BORDER);
+ OpenThemeData(infoPtr->hwndSelf, themeClass);
return 0;
}
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 21b655b197f..462782a1b11 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -77,11 +77,11 @@ static void init_system_font_height(void) {
system_font_height = tm.tmHeight;
}
-static HWND create_rebar_control(void)
+static HWND create_rebar_control(DWORD style)
{
HWND hwnd;
- hwnd = CreateWindowA(REBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
+ hwnd = CreateWindowA(REBARCLASSNAMEA, NULL, style | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
hMainWnd, (HMENU)17, GetModuleHandleA(NULL), NULL);
ok(hwnd != NULL, "Failed to create Rebar\n");
@@ -499,7 +499,7 @@ static void test_layout(void)
rbsize_results_init();
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
check_sizes();
rbi.cbSize = REBARBANDINFOA_V6_SIZE;
rbi.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD;
@@ -559,7 +559,7 @@ static void test_layout(void)
DestroyWindow(hRebar);
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
add_band_w(hRebar, "ABC", 70, 40, 100);
add_band_w(hRebar, NULL, 40, 70, 100);
add_band_w(hRebar, NULL, 170, 240, 100);
@@ -602,7 +602,7 @@ static void test_layout(void)
DestroyWindow(hRebar);
/* VARHEIGHT resizing test on a horizontal rebar */
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
SetWindowLongA(hRebar, GWL_STYLE, GetWindowLongA(hRebar, GWL_STYLE) | RBS_AUTOSIZE);
check_sizes();
rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE;
@@ -630,7 +630,7 @@ static void test_layout(void)
DestroyWindow(hRebar);
/* VARHEIGHT resizing on a vertical rebar */
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
SetWindowLongA(hRebar, GWL_STYLE, GetWindowLongA(hRebar, GWL_STYLE) | CCS_VERT | RBS_AUTOSIZE);
check_sizes();
rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE;
@@ -661,7 +661,7 @@ static void test_layout(void)
pImageList_Destroy(himl);
/* One hidden band. */
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
rbi.cbSize = REBARBANDINFOA_V6_SIZE;
rbi.fMask = RBBIM_STYLE | RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD;
@@ -966,7 +966,7 @@ static void test_bandinfo(void)
CHAR szABCD[] = "ABCD";
HWND hRebar;
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
rb.cbSize = REBARBANDINFOA_V6_SIZE;
rb.fMask = 0;
if (!SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rb))
@@ -1027,7 +1027,7 @@ static void test_colors(void)
HWND hRebar;
REBARBANDINFOA bi;
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
/* test default colors */
clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0);
@@ -1106,7 +1106,7 @@ static void test_showband(void)
REBARBANDINFOA rbi;
BOOL ret;
- hRebar = create_rebar_control();
+ hRebar = create_rebar_control(0);
/* no bands */
ret = SendMessageA(hRebar, RB_SHOWBAND, 0, TRUE);
@@ -1135,7 +1135,7 @@ static void test_notification(void)
MEASUREITEMSTRUCT mis;
HWND rebar;
- rebar = create_rebar_control();
+ rebar = create_rebar_control(0);
g_parent_measureitem = 0;
SendMessageA(rebar, WM_MEASUREITEM, 0, (LPARAM)&mis);
@@ -1144,6 +1144,33 @@ static void test_notification(void)
DestroyWindow(rebar);
}
+static void test_style(void)
+{
+ STYLESTRUCT style_struct;
+ LONG style;
+ HWND hwnd;
+ RECT rect;
+
+ /* WS_BORDER */
+ hwnd = create_rebar_control(WS_BORDER);
+ ok(GetWindowLongW(hwnd, GWL_STYLE) & WS_BORDER, "Expected WS_BORDER.\n");
+
+ GetClientRect(hwnd, &rect);
+ SendMessageW(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
+ ok(GetWindowLongW(hwnd, GWL_STYLE) & WS_BORDER, "Expected WS_BORDER.\n");
+
+ SendMessageW(hwnd, WM_THEMECHANGED, 0, 0);
+ style = GetWindowLongW(hwnd, GWL_STYLE);
+ ok(style & WS_BORDER, "Expected WS_BORDER.\n");
+
+ style_struct.styleOld = style;
+ style_struct.styleNew = style | WS_DLGFRAME;
+ SendMessageW(hwnd, WM_STYLECHANGED, (WPARAM)GWL_STYLE, (LPARAM)&style_struct);
+ ok(GetWindowLongW(hwnd, GWL_STYLE) & WS_BORDER, "Expected WS_BORDER.\n");
+
+ DestroyWindow(hwnd);
+}
+
static void init_functions(void)
{
HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
@@ -1176,6 +1203,7 @@ START_TEST(rebar)
test_layout();
test_resize();
+ test_style();
out:
PostQuitMessage(0);
--
2.30.2
1
0
Oct. 6, 2021
Fix rebar test failures when theming is on.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/rebar.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index af35008b692..84390bd0b52 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -3207,19 +3207,13 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam)
static inline LRESULT
REBAR_NCCalcSize (const REBAR_INFO *infoPtr, RECT *rect)
{
- HTHEME theme;
-
if (infoPtr->dwStyle & WS_BORDER) {
rect->left = min(rect->left + GetSystemMetrics(SM_CXEDGE), rect->right);
rect->right = max(rect->right - GetSystemMetrics(SM_CXEDGE), rect->left);
rect->top = min(rect->top + GetSystemMetrics(SM_CYEDGE), rect->bottom);
rect->bottom = max(rect->bottom - GetSystemMetrics(SM_CYEDGE), rect->top);
}
- else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
- {
- /* FIXME: should use GetThemeInt */
- rect->top = min(rect->top + 1, rect->bottom);
- }
+
TRACE("new client=(%s)\n", wine_dbgstr_rect(rect));
return 0;
}
--
2.30.2
1
0