Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
October 2021
- 81 participants
- 2597 messages
Re: [PATCH 2/2] vbscript: Handle Recursive calls.
by Jacek Caban
On 10/1/21 8:13 AM, Robert Wilhelm wrote:
> diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
> index f5353b33cae..b23df0fc589 100644
> --- a/dlls/vbscript/vbscript.h
> +++ b/dlls/vbscript/vbscript.h
> @@ -57,6 +57,7 @@ typedef struct _vbdisp_t vbdisp_t;
>
> typedef enum {
> VBDISP_CALLGET,
> + VBDISP_IDENT,
> VBDISP_LET,
> VBDISP_SET,
> VBDISP_ANY
This will cause a new entry in vbdisp_funcprop_desc_t.
Since the distinction matters only to do_icall, how about fixing the
problem there? It could detect check for recursive appropriate and don't
call lookup_identifier in that case.
Thanks,
Jacek
Oct. 1, 2021
[PATCH 4/4] nsiproxy: Build with msvcrt.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/nsiproxy.sys/Makefile.in | 5 +++--
dlls/nsiproxy.sys/device.c | 30 ++++++++++++++++++++++++++----
dlls/nsiproxy.sys/ip.c | 6 ++++++
dlls/nsiproxy.sys/ndis.c | 9 +++++++--
dlls/nsiproxy.sys/nsi.c | 30 ++++++++++++++++++++++++++++++
dlls/nsiproxy.sys/tcp.c | 4 ++++
dlls/nsiproxy.sys/udp.c | 4 ++++
7 files changed, 80 insertions(+), 8 deletions(-)
diff --git a/dlls/nsiproxy.sys/Makefile.in b/dlls/nsiproxy.sys/Makefile.in
index b33ea0e4c8a..95f2a205816 100644
--- a/dlls/nsiproxy.sys/Makefile.in
+++ b/dlls/nsiproxy.sys/Makefile.in
@@ -1,8 +1,9 @@
MODULE = nsiproxy.sys
-IMPORTS = ntoskrnl uuid
+UNIXLIB = nsiproxy.so
+IMPORTS = ntoskrnl
EXTRALIBS = $(PROCSTAT_LIBS)
-EXTRADLLFLAGS = -Wl,--subsystem,native -mcygwin
+EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
device.c \
diff --git a/dlls/nsiproxy.sys/device.c b/dlls/nsiproxy.sys/device.c
index 80a025acfc9..ee2feec96be 100644
--- a/dlls/nsiproxy.sys/device.c
+++ b/dlls/nsiproxy.sys/device.c
@@ -32,10 +32,24 @@
#include "netiodef.h"
#include "wine/nsi.h"
#include "wine/debug.h"
-#include "nsiproxy_private.h"
+#include "wine/unixlib.h"
WINE_DEFAULT_DEBUG_CHANNEL(nsi);
+static unixlib_handle_t nsiproxy_handle;
+
+static NTSTATUS nsiproxy_call( unsigned int code, void *args )
+{
+ return __wine_unix_call( nsiproxy_handle, code, args );
+}
+
+enum unix_calls
+{
+ nsi_enumerate_all_ex,
+ nsi_get_all_parameters_ex,
+ nsi_get_parameter_ex,
+};
+
static void nsiproxy_enumerate_all( IRP *irp )
{
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
@@ -73,7 +87,7 @@ static void nsiproxy_enumerate_all( IRP *irp )
enum_all.static_size = in->static_size;
enum_all.count = in->count;
- irp->IoStatus.u.Status = nsi_enumerate_all_ex( &enum_all );
+ irp->IoStatus.u.Status = nsiproxy_call( nsi_enumerate_all_ex, &enum_all );
if (irp->IoStatus.u.Status == STATUS_SUCCESS || irp->IoStatus.u.Status == STATUS_BUFFER_OVERFLOW)
{
irp->IoStatus.Information = out_len;
@@ -119,7 +133,7 @@ static void nsiproxy_get_all_parameters( IRP *irp )
get_all.static_data = out + in->rw_size + in->dynamic_size;
get_all.static_size = in->static_size;
- irp->IoStatus.u.Status = nsi_get_all_parameters_ex( &get_all );
+ irp->IoStatus.u.Status = nsiproxy_call( nsi_get_all_parameters_ex, &get_all );
irp->IoStatus.Information = (irp->IoStatus.u.Status == STATUS_SUCCESS) ? out_len : 0;
}
@@ -152,7 +166,7 @@ static void nsiproxy_get_parameter( IRP *irp )
get_param.data_size = out_len;
get_param.data_offset = in->data_offset;
- irp->IoStatus.u.Status = nsi_get_parameter_ex( &get_param );
+ irp->IoStatus.u.Status = nsiproxy_call( nsi_get_parameter_ex, &get_param );
irp->IoStatus.Information = irp->IoStatus.u.Status == STATUS_SUCCESS ? out_len : 0;
}
@@ -215,8 +229,16 @@ static int add_device( DRIVER_OBJECT *driver )
NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
{
+ HMODULE instance;
+ NTSTATUS status;
+
TRACE( "(%p, %s)\n", driver, debugstr_w( path->Buffer ) );
+ RtlPcToFileHeader( &DriverEntry, (void *)&instance );
+ status = NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs,
+ &nsiproxy_handle, sizeof(nsiproxy_handle), NULL );
+ if (status) return status;
+
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = nsi_ioctl;
add_device( driver );
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c
index fe2bf29d7aa..7d734567c5b 100644
--- a/dlls/nsiproxy.sys/ip.c
+++ b/dlls/nsiproxy.sys/ip.c
@@ -18,6 +18,12 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
+#define _NTSYSTEM_
+
#include "config.h"
#include <stdarg.h>
diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index 73159a89805..7de343f00fe 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -18,6 +18,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include <stdarg.h>
@@ -85,6 +89,7 @@
#include "wine/nsi.h"
#include "wine/list.h"
#include "wine/debug.h"
+#include "wine/unixlib.h"
#include "nsiproxy_private.h"
@@ -251,9 +256,9 @@ static WCHAR *strdupAtoW( const char *str )
DWORD len;
if (!str) return ret;
- len = MultiByteToWideChar( CP_UNIXCP, 0, str, -1, NULL, 0 );
+ len = strlen( str ) + 1;
ret = malloc( len * sizeof(WCHAR) );
- if (ret) MultiByteToWideChar( CP_UNIXCP, 0, str, -1, ret, len );
+ if (ret) ntdll_umbstowcs( str, len, ret, len );
return ret;
}
diff --git a/dlls/nsiproxy.sys/nsi.c b/dlls/nsiproxy.sys/nsi.c
index e29446abb50..ccfc325a085 100644
--- a/dlls/nsiproxy.sys/nsi.c
+++ b/dlls/nsiproxy.sys/nsi.c
@@ -17,6 +17,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
#include <stdarg.h>
@@ -28,9 +31,11 @@
#include "winioctl.h"
#include "ddk/wdm.h"
#include "ifdef.h"
+#define __WINE_INIT_NPI_MODULEID
#include "netiodef.h"
#include "wine/nsi.h"
#include "wine/debug.h"
+#include "wine/unixlib.h"
#include "nsiproxy_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(nsi);
@@ -121,3 +126,28 @@ NTSTATUS nsi_get_parameter_ex( struct nsi_get_parameter_ex *params )
return entry->get_parameter( params->key, params->key_size, params->param_type,
params->data, params->data_size, params->data_offset );
}
+
+static NTSTATUS unix_nsi_enumerate_all_ex( void *args )
+{
+ struct nsi_enumerate_all_ex *params = (struct nsi_enumerate_all_ex *)args;
+ return nsi_enumerate_all_ex( params );
+}
+
+static NTSTATUS unix_nsi_get_all_parameters_ex( void *args )
+{
+ struct nsi_get_all_parameters_ex *params = (struct nsi_get_all_parameters_ex *)args;
+ return nsi_get_all_parameters_ex( params );
+}
+
+static NTSTATUS unix_nsi_get_parameter_ex( void *args )
+{
+ struct nsi_get_parameter_ex *params = (struct nsi_get_parameter_ex *)args;
+ return nsi_get_parameter_ex( params );
+}
+
+const unixlib_entry_t __wine_unix_call_funcs[] =
+{
+ unix_nsi_enumerate_all_ex,
+ unix_nsi_get_all_parameters_ex,
+ unix_nsi_get_parameter_ex
+};
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c
index fcb57a5e6b2..f98ae3955b8 100644
--- a/dlls/nsiproxy.sys/tcp.c
+++ b/dlls/nsiproxy.sys/tcp.c
@@ -19,6 +19,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include <stdarg.h>
diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c
index 87a4d487e0a..1c42912655e 100644
--- a/dlls/nsiproxy.sys/udp.c
+++ b/dlls/nsiproxy.sys/udp.c
@@ -18,6 +18,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include <stdarg.h>
#include <stddef.h>
--
2.25.1
Oct. 1, 2021
[PATCH 3/4] nsiproxy: Switch memory allocations to malloc().
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/nsiproxy.sys/ip.c | 13 ++++++-------
dlls/nsiproxy.sys/ndis.c | 11 +++++------
dlls/nsiproxy.sys/tcp.c | 33 ++++++++++++++++-----------------
dlls/nsiproxy.sys/udp.c | 9 ++++-----
4 files changed, 31 insertions(+), 35 deletions(-)
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c
index aabf82d4d86..fe2bf29d7aa 100644
--- a/dlls/nsiproxy.sys/ip.c
+++ b/dlls/nsiproxy.sys/ip.c
@@ -94,7 +94,6 @@
#include "ifdef.h"
#include "ipmib.h"
#include "netiodef.h"
-#include "wine/heap.h"
#include "wine/nsi.h"
#include "wine/debug.h"
@@ -933,12 +932,12 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, vo
if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) == -1) return STATUS_NOT_SUPPORTED;
- buf = heap_alloc( needed );
+ buf = malloc( needed );
if (!buf) return STATUS_NO_MEMORY;
if (sysctl( mib, ARRAY_SIZE(mib), buf, &needed, NULL, 0 ) == -1)
{
- heap_free( buf );
+ free( buf );
return STATUS_NOT_SUPPORTED;
}
@@ -982,7 +981,7 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, vo
}
next += rtm->rtm_msglen;
}
- heap_free( buf );
+ free( buf );
}
#else
FIXME( "not implemented\n" );
@@ -1122,12 +1121,12 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void
if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) < 0) return STATUS_NOT_SUPPORTED;
- buf = heap_alloc( needed );
+ buf = malloc( needed );
if (!buf) return STATUS_NO_MEMORY;
if (sysctl( mib, 6, buf, &needed, NULL, 0 ) < 0)
{
- heap_free( buf );
+ free( buf );
return STATUS_NOT_SUPPORTED;
}
@@ -1225,7 +1224,7 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void
}
num++;
}
- HeapFree( GetProcessHeap (), 0, buf );
+ free( buf );
}
#else
FIXME( "not implemented\n" );
diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index d75855dcf67..73159a89805 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -84,7 +84,6 @@
#include "ddk/wdm.h"
#include "wine/nsi.h"
#include "wine/list.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "nsiproxy_private.h"
@@ -253,7 +252,7 @@ static WCHAR *strdupAtoW( const char *str )
if (!str) return ret;
len = MultiByteToWideChar( CP_UNIXCP, 0, str, -1, NULL, 0 );
- ret = heap_alloc( len * sizeof(WCHAR) );
+ ret = malloc( len * sizeof(WCHAR) );
if (ret) MultiByteToWideChar( CP_UNIXCP, 0, str, -1, ret, len );
return ret;
}
@@ -264,7 +263,7 @@ static struct if_entry *add_entry( DWORD index, char *name )
int name_len = strlen( name );
if (name_len >= IFNAMSIZ - 1) return NULL;
- entry = heap_alloc( sizeof(*entry) );
+ entry = malloc( sizeof(*entry) );
if (!entry) return NULL;
entry->if_index = index;
@@ -272,7 +271,7 @@ static struct if_entry *add_entry( DWORD index, char *name )
entry->if_name = strdupAtoW( name );
if (!entry->if_name)
{
- heap_free( entry );
+ free( entry );
return NULL;
}
@@ -385,7 +384,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_
struct if_data ifdata;
if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) == -1) goto done;
- buf = heap_alloc( needed );
+ buf = malloc( needed );
if (!buf) goto done;
if (sysctl( mib, ARRAY_SIZE(mib), buf, &needed, NULL, 0 ) == -1) goto done;
for (end = buf + needed; buf < end; buf += ifm->ifm_msglen)
@@ -408,7 +407,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_
}
}
done:
- heap_free( buf );
+ free( buf );
}
#endif
}
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c
index 32939251dbe..fcb57a5e6b2 100644
--- a/dlls/nsiproxy.sys/tcp.c
+++ b/dlls/nsiproxy.sys/tcp.c
@@ -97,7 +97,6 @@
#include "netiodef.h"
#include "ws2ipdef.h"
#include "tcpmib.h"
-#include "wine/heap.h"
#include "wine/nsi.h"
#include "wine/debug.h"
#include "wine/server.h"
@@ -269,7 +268,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size )
{
if (!table_size) table_size = 4;
else table_size *= 2;
- if (!(table = heap_realloc( table, table_size * sizeof(table[0]) )))
+ if (!(table = realloc( table, table_size * sizeof(table[0]) )))
{
fclose( fp );
goto failed;
@@ -301,7 +300,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size )
{
if (!table_size) table_size = 4;
else table_size *= 2;
- if (!(table = heap_realloc( table, table_size * sizeof(table[0]) )))
+ if (!(table = realloc( table, table_size * sizeof(table[0]) )))
{
freeifaddrs( addrs );
goto failed;
@@ -325,7 +324,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size )
return table;
failed:
- heap_free( table );
+ free( table );
return NULL;
}
@@ -356,7 +355,7 @@ struct pid_map *get_pid_map( unsigned int *num_entries )
NTSTATUS ret;
char *buffer = NULL, *new_buffer;
- if (!(buffer = heap_alloc( buffer_len ))) return NULL;
+ if (!(buffer = malloc( buffer_len ))) return NULL;
for (;;)
{
@@ -371,17 +370,17 @@ struct pid_map *get_pid_map( unsigned int *num_entries )
if (ret != STATUS_INFO_LENGTH_MISMATCH) break;
- if (!(new_buffer = heap_realloc( buffer, buffer_len )))
+ if (!(new_buffer = realloc( buffer, buffer_len )))
{
- heap_free( buffer );
+ free( buffer );
return NULL;
}
buffer = new_buffer;
}
- if (!(map = heap_alloc( process_count * sizeof(*map) )))
+ if (!(map = malloc( process_count * sizeof(*map) )))
{
- heap_free( buffer );
+ free( buffer );
return NULL;
}
@@ -400,7 +399,7 @@ struct pid_map *get_pid_map( unsigned int *num_entries )
pos += process->thread_count * sizeof(struct thread_info);
}
- heap_free( buffer );
+ free( buffer );
*num_entries = process_count;
return map;
}
@@ -495,7 +494,7 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN
int fd_len = proc_pidinfo( map[i].unix_pid, PROC_PIDLISTFDS, 0, NULL, 0 );
if (fd_len <= 0) continue;
- fds = heap_alloc( fd_len );
+ fds = malloc( fd_len );
if (!fds) continue;
proc_pidinfo( map[i].unix_pid, PROC_PIDLISTFDS, 0, fds, fd_len );
@@ -507,12 +506,12 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN
proc_pidfdinfo( map[i].unix_pid, fds[j].proc_fd, PROC_PIDFDSOCKETINFO, &sock, sizeof(sock) );
if (sock.psi.soi_pcb == inode)
{
- heap_free( fds );
+ free( fds );
return map[i].pid;
}
}
- heap_free( fds );
+ free( fds );
}
return 0;
#else
@@ -638,7 +637,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
goto err;
}
- buf = heap_alloc( len );
+ buf = malloc( len );
if (!buf)
{
status = STATUS_NO_MEMORY;
@@ -728,7 +727,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
num++;
}
err:
- heap_free( buf );
+ free( buf );
}
#else
FIXME( "not implemented\n" );
@@ -738,8 +737,8 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
if (!want_data || num <= *count) *count = num;
else status = STATUS_BUFFER_OVERFLOW;
- heap_free( pid_map );
- heap_free( addr_scopes );
+ free( pid_map );
+ free( addr_scopes );
return status;
}
diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c
index efd18392a45..87a4d487e0a 100644
--- a/dlls/nsiproxy.sys/udp.c
+++ b/dlls/nsiproxy.sys/udp.c
@@ -77,7 +77,6 @@
#include "netiodef.h"
#include "ws2ipdef.h"
#include "udpmib.h"
-#include "wine/heap.h"
#include "wine/nsi.h"
#include "wine/debug.h"
#include "wine/server.h"
@@ -309,7 +308,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void
goto err;
}
- buf = heap_alloc( len );
+ buf = malloc( len );
if (!buf)
{
status = STATUS_NO_MEMORY;
@@ -386,7 +385,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void
num++;
}
err:
- heap_free( buf );
+ free( buf );
}
#else
FIXME( "not implemented\n" );
@@ -396,8 +395,8 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void
if (!want_data || num <= *count) *count = num;
else status = STATUS_BUFFER_OVERFLOW;
- heap_free( pid_map );
- heap_free( addr_scopes );
+ free( pid_map );
+ free( addr_scopes );
return status;
}
--
2.25.1
Oct. 1, 2021
[PATCH 2/4] nsiproxy: Use str(n)casecmp() instead of _strnicmp().
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/nsiproxy.sys/ip.c | 22 +++++++++++-----------
dlls/nsiproxy.sys/ndis.c | 2 +-
dlls/nsiproxy.sys/tcp.c | 4 ++--
dlls/nsiproxy.sys/udp.c | 6 +++---
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c
index 12fae3f2f12..aabf82d4d86 100644
--- a/dlls/nsiproxy.sys/ip.c
+++ b/dlls/nsiproxy.sys/ip.c
@@ -261,10 +261,10 @@ static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, DWORD key_si
while ((ptr = fgets( buf, sizeof(buf), fp )))
{
- if (_strnicmp( buf, hdr, sizeof(hdr) - 1 )) continue;
+ if (strncasecmp( buf, hdr, sizeof(hdr) - 1 )) continue;
/* last line was a header, get another */
if (!(ptr = fgets( buf, sizeof(buf), fp ))) break;
- if (!_strnicmp( buf, hdr, sizeof(hdr) - 1 ))
+ if (!strncasecmp( buf, hdr, sizeof(hdr) - 1 ))
{
ptr += sizeof(hdr);
sscanf( ptr, "%u %u %*u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u",
@@ -427,13 +427,13 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
while (*value == ' ') value++;
if ((ptr = strchr( value, '\n' ))) *ptr='\0';
- if (!_strnicmp( buf, "Icmp6InMsgs", -1 ))
+ if (!strcasecmp( buf, "Icmp6InMsgs" ))
{
if (sscanf( value, "%d", &res )) dyn.in_msgs = res;
continue;
}
- if (!_strnicmp( buf, "Icmp6InErrors", -1 ))
+ if (!strcasecmp( buf, "Icmp6InErrors" ))
{
if (sscanf( value, "%d", &res )) dyn.in_errors = res;
continue;
@@ -441,7 +441,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
for (i = 0; i < ARRAY_SIZE(in_list); i++)
{
- if (!_strnicmp( buf, in_list[i].name, -1 ))
+ if (!strcasecmp( buf, in_list[i].name ))
{
if (sscanf( value, "%d", &res ))
dyn.in_type_counts[in_list[i].pos] = res;
@@ -449,13 +449,13 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
}
}
- if (!_strnicmp( buf, "Icmp6OutMsgs", -1 ))
+ if (!strcasecmp( buf, "Icmp6OutMsgs" ))
{
if (sscanf( value, "%d", &res )) dyn.out_msgs = res;
continue;
}
- if (!_strnicmp( buf, "Icmp6OutErrors", -1 ))
+ if (!strcasecmp( buf, "Icmp6OutErrors" ))
{
if (sscanf( value, "%d", &res )) dyn.out_errors = res;
continue;
@@ -463,7 +463,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
for (i = 0; i < ARRAY_SIZE(out_list); i++)
{
- if (!_strnicmp( buf, out_list[i].name, -1 ))
+ if (!strcasecmp( buf, out_list[i].name ))
{
if (sscanf( value, "%d", &res ))
dyn.out_type_counts[out_list[i].pos] = res;
@@ -504,10 +504,10 @@ static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, DWORD key_size
while ((ptr = fgets( buf, sizeof(buf), fp )))
{
- if (_strnicmp( buf, hdr, sizeof(hdr) - 1 )) continue;
+ if (strncasecmp( buf, hdr, sizeof(hdr) - 1 )) continue;
/* last line was a header, get another */
if (!(ptr = fgets( buf, sizeof(buf), fp ))) break;
- if (!_strnicmp( buf, hdr, sizeof(hdr) - 1 ))
+ if (!strncasecmp( buf, hdr, sizeof(hdr) - 1 ))
{
DWORD in_recv, in_hdr_errs, fwd_dgrams, in_delivers, out_reqs;
ptr += sizeof(hdr);
@@ -643,7 +643,7 @@ static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, DWORD key_size
if ((ptr = strchr( value, '\n' ))) *ptr = '\0';
for (i = 0; i < ARRAY_SIZE(ipstatlist); i++)
- if (!_strnicmp( buf, ipstatlist[i].name, -1 ))
+ if (!strcasecmp( buf, ipstatlist[i].name ))
{
if (ipstatlist[i].size == sizeof(long))
*(long *)ipstatlist[i].elem = strtoul( value, NULL, 10 );
diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index 1d0e69c593c..d75855dcf67 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -354,7 +354,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_
while ((ptr = fgets( buf, sizeof(buf), fp )))
{
while (*ptr && isspace( *ptr )) ptr++;
- if (!_strnicmp( ptr, entry->if_unix_name, name_len ) && ptr[name_len] == ':')
+ if (!strncasecmp( ptr, entry->if_unix_name, name_len ) && ptr[name_len] == ':')
{
unsigned long long values[9];
ptr += name_len + 1;
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c
index f9ddf1a2b23..32939251dbe 100644
--- a/dlls/nsiproxy.sys/tcp.c
+++ b/dlls/nsiproxy.sys/tcp.c
@@ -147,10 +147,10 @@ static NTSTATUS tcp_stats_get_all_parameters( const void *key, DWORD key_size, v
while ((ptr = fgets( buf, sizeof(buf), fp )))
{
- if (_strnicmp( buf, hdr, sizeof(hdr) - 1 )) continue;
+ if (strncasecmp( buf, hdr, sizeof(hdr) - 1 )) continue;
/* last line was a header, get another */
if (!(ptr = fgets( buf, sizeof(buf), fp ))) break;
- if (!_strnicmp( buf, hdr, sizeof(hdr) - 1 ))
+ if (!strncasecmp( buf, hdr, sizeof(hdr) - 1 ))
{
DWORD in_segs, out_segs;
ptr += sizeof(hdr);
diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c
index a0ace071753..efd18392a45 100644
--- a/dlls/nsiproxy.sys/udp.c
+++ b/dlls/nsiproxy.sys/udp.c
@@ -123,10 +123,10 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v
while ((ptr = fgets( buf, sizeof(buf), fp )))
{
- if (_strnicmp( buf, hdr, sizeof(hdr) - 1) ) continue;
+ if (strncasecmp( buf, hdr, sizeof(hdr) - 1 )) continue;
/* last line was a header, get another */
if (!(ptr = fgets( buf, sizeof(buf), fp ))) break;
- if (!_strnicmp(buf, hdr, sizeof(hdr) - 1))
+ if (!strncasecmp( buf, hdr, sizeof(hdr) - 1 ))
{
unsigned int in_dgrams, out_dgrams;
ptr += sizeof(hdr);
@@ -176,7 +176,7 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v
if ((ptr = strchr( value, '\n' ))) *ptr='\0';
for (i = 0; i < ARRAY_SIZE(udp_stat_list); i++)
- if (!_strnicmp( buf, udp_stat_list[i].name, -1 ) && sscanf( value, "%d", &res ))
+ if (!strcasecmp( buf, udp_stat_list[i].name ) && sscanf( value, "%d", &res ))
*udp_stat_list[i].elem = res;
}
dyn.in_dgrams = in_dgrams;
--
2.25.1
Oct. 1, 2021
[PATCH 1/4] nsiproxy: Use a pthread_mutex to guard the interface list.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/nsiproxy.sys/ndis.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index bf237ea16db..1d0e69c593c 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -66,6 +66,8 @@
#include <net/if_types.h>
#endif
+#include <pthread.h>
+
#define NONAMELESSUNION
#include "ntstatus.h"
#define WIN32_NO_STATUS
@@ -102,15 +104,7 @@ struct if_entry
};
static struct list if_list = LIST_INIT( if_list );
-
-static CRITICAL_SECTION if_list_cs;
-static CRITICAL_SECTION_DEBUG if_list_cs_debug =
-{
- 0, 0, &if_list_cs,
- { &if_list_cs_debug.ProcessLocksList, &if_list_cs_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": if_list_cs") }
-};
-static CRITICAL_SECTION if_list_cs = { &if_list_cs_debug, -1, 0, 0, 0, 0 };
+static pthread_mutex_t if_list_lock = PTHREAD_MUTEX_INITIALIZER;
static struct if_entry *find_entry_from_index( DWORD index )
{
@@ -468,7 +462,7 @@ static NTSTATUS ifinfo_enumerate_all( void *key_data, DWORD key_size, void *rw_d
TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size,
dynamic_data, dynamic_size, static_data, static_size, count );
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -485,7 +479,7 @@ static NTSTATUS ifinfo_enumerate_all( void *key_data, DWORD key_size, void *rw_d
num++;
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
if (!want_data || num <= *count) *count = num;
else status = STATUS_BUFFER_OVERFLOW;
@@ -503,7 +497,7 @@ static NTSTATUS ifinfo_get_all_parameters( const void *key, DWORD key_size, void
TRACE( "%p %d %p %d %p %d %p %d\n", key, key_size, rw_data, rw_size,
dynamic_data, dynamic_size, static_data, static_size );
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -514,7 +508,7 @@ static NTSTATUS ifinfo_get_all_parameters( const void *key, DWORD key_size, void
status = STATUS_SUCCESS;
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
return status;
}
@@ -565,7 +559,7 @@ static NTSTATUS ifinfo_get_parameter( const void *key, DWORD key_size, DWORD par
TRACE( "%p %d %d %p %d %d\n", key, key_size, param_type, data, data_size, data_offset );
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -583,7 +577,7 @@ static NTSTATUS ifinfo_get_parameter( const void *key, DWORD key_size, DWORD par
}
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
return status;
}
@@ -599,7 +593,7 @@ static NTSTATUS index_luid_get_parameter( const void *key, DWORD key_size, DWORD
if (param_type != NSI_PARAM_TYPE_STATIC || data_size != sizeof(NET_LUID) || data_offset != 0)
return STATUS_INVALID_PARAMETER;
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -609,7 +603,7 @@ static NTSTATUS index_luid_get_parameter( const void *key, DWORD key_size, DWORD
*(NET_LUID *)data = entry->if_luid;
status = STATUS_SUCCESS;
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
return status;
}
@@ -618,7 +612,7 @@ BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid )
struct if_entry *entry;
BOOL ret = FALSE;
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -629,7 +623,7 @@ BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid )
ret = TRUE;
break;
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
return ret;
}
@@ -639,7 +633,7 @@ BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name )
struct if_entry *entry;
BOOL ret = FALSE;
- EnterCriticalSection( &if_list_cs );
+ pthread_mutex_lock( &if_list_lock );
update_if_table();
@@ -650,7 +644,7 @@ BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name )
ret = TRUE;
}
- LeaveCriticalSection( &if_list_cs );
+ pthread_mutex_unlock( &if_list_lock );
return ret;
}
--
2.25.1
Oct. 1, 2021
Re: [PATCH v2 3/3] gdi32: Use NtAllocateVirtualMemory to allocate GDI_SHARED_MEMORY.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Oct. 1, 2021
Re: [PATCH v2 2/3] gdi32: Use NtAllocateVirtualMemory to alloc DC_ATTR.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Oct. 1, 2021
Re: [PATCH v2 1/3] gdi32: Use native memory allocators in Unix library.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Oct. 1, 2021
[PATCH] hidparse.sys: Preserve the original report_count in parse_new_value_caps.
by Rémi Bernon
From: Ivo Ivanov <logos128(a)gmail.com>
We force state->items.report_count to 1 while building the alternate
value array, but the item is global and should be preserved across caps.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51822
Signed-off-by: Ivo Ivanov <logos128(a)gmail.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput8/tests/hid.c | 9 ++++-----
dlls/hidparse.sys/main.c | 2 ++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 71989ef1b3c..0cfcfedc6cf 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -1784,8 +1784,8 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
status = HidP_SetUsages( HidP_Input, HID_USAGE_PAGE_KEYBOARD, 0, usages, &value, preparsed_data,
report, caps.InputReportByteLength );
ok( status == HIDP_STATUS_BUFFER_TOO_SMALL, "HidP_SetUsages returned %#x\n", status );
- buffer[6] = 2;
- buffer[7] = 4;
+ buffer[13] = 2;
+ buffer[14] = 4;
ok( !memcmp( buffer, report, caps.InputReportByteLength ), "unexpected report data\n" );
status = HidP_SetUsageValue( HidP_Input, HID_USAGE_PAGE_LED, 0, 6, 1, preparsed_data, report,
@@ -2502,8 +2502,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
REPORT_COUNT(1, 8),
REPORT_SIZE(1, 1),
INPUT(1, Cnst|Var|Abs),
- REPORT_COUNT(1, 8),
- REPORT_SIZE(1, 1),
+ REPORT_SIZE(1, 8),
INPUT(1, Cnst|Var|Abs),
/* needs to be 8 bit aligned as next has Buff */
@@ -2724,7 +2723,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
{
.Usage = HID_USAGE_GENERIC_JOYSTICK,
.UsagePage = HID_USAGE_PAGE_GENERIC,
- .InputReportByteLength = report_id ? 25 : 26,
+ .InputReportByteLength = report_id ? 32 : 33,
.OutputReportByteLength = report_id ? 2 : 3,
.FeatureReportByteLength = report_id ? 21 : 22,
.NumberLinkCollectionNodes = 10,
diff --git a/dlls/hidparse.sys/main.c b/dlls/hidparse.sys/main.c
index ca15a91c75a..18ee23974f0 100644
--- a/dlls/hidparse.sys/main.c
+++ b/dlls/hidparse.sys/main.c
@@ -360,6 +360,7 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
{
struct hid_value_caps *values;
USAGE usage_page = state->items.usage_page;
+ USHORT report_count = state->items.report_count;
DWORD i, usages_size = max( 1, state->usages_size );
USHORT *byte_length = &state->byte_length[type];
ULONG start_bit, *bit_size = &state->bit_size[type][state->items.report_id];
@@ -408,6 +409,7 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
state->data_count[type] = state->items.data_index_max + 1;
state->items.usage_page = usage_page;
+ state->items.report_count = report_count;
reset_local_items( state );
return TRUE;
}
--
2.33.0
Oct. 1, 2021
[PATCH 10/10] winebus.sys: Implement PID device control for UDEV lnxev devices.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/winebus.sys/bus_udev.c | 60 ++++++++++++++++++++++++++++++++++---
1 file changed, 56 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index e4c0103b270..454ab3ea870 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -70,9 +70,9 @@
#include "ddk/wdm.h"
#include "ddk/hidtypes.h"
#include "ddk/hidsdi.h"
+
#include "wine/debug.h"
-#include "wine/heap.h"
-#include "wine/unicode.h"
+#include "wine/hid.h"
#ifdef HAS_PROPER_INPUT_HEADER
# include "hidusage.h"
@@ -140,6 +140,7 @@ struct lnxev_device
BYTE button_map[KEY_MAX];
int haptic_effect_id;
+ int effect_ids[256];
};
static inline struct lnxev_device *lnxev_impl_from_unix_device(struct unix_device *iface)
@@ -642,6 +643,8 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d
return STATUS_NO_MEMORY;
impl->haptic_effect_id = -1;
+ for (i = 0; i < ARRAY_SIZE(impl->effect_ids); ++i) impl->effect_ids[i] = -1;
+
if (test_bit(ffbits, FF_RUMBLE))
{
effect.id = -1;
@@ -811,9 +814,58 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, DWORD dura
static NTSTATUS lnxev_device_physical_device_control(struct unix_device *iface, USAGE control)
{
- FIXME("iface %p, control %#04x stub!\n", iface, control);
+ struct lnxev_device *impl = lnxev_impl_from_unix_device(iface);
+ unsigned int i;
- return STATUS_NOT_IMPLEMENTED;
+ TRACE("iface %p, control %#04x.\n", iface, control);
+
+ switch (control)
+ {
+ case PID_USAGE_DC_ENABLE_ACTUATORS:
+ {
+ struct input_event ie =
+ {
+ .type = EV_FF,
+ .code = FF_GAIN,
+ .value = 0xffff,
+ };
+ if (write(impl->base.device_fd, &ie, sizeof(ie)) == -1)
+ WARN("write failed %d %s\n", errno, strerror(errno));
+ return STATUS_SUCCESS;
+ }
+ case PID_USAGE_DC_DISABLE_ACTUATORS:
+ {
+ struct input_event ie =
+ {
+ .type = EV_FF,
+ .code = FF_GAIN,
+ .value = 0,
+ };
+ if (write(impl->base.device_fd, &ie, sizeof(ie)) == -1)
+ WARN("write failed %d %s\n", errno, strerror(errno));
+ return STATUS_SUCCESS;
+ }
+ case PID_USAGE_DC_STOP_ALL_EFFECTS:
+ FIXME("stop all not implemented!\n");
+ return STATUS_NOT_IMPLEMENTED;
+ case PID_USAGE_DC_DEVICE_RESET:
+ for (i = 0; i < ARRAY_SIZE(impl->effect_ids); ++i)
+ {
+ if (impl->effect_ids[i] < 0) continue;
+ if (ioctl(impl->base.device_fd, EVIOCRMFF, impl->effect_ids[i]) == -1)
+ WARN("couldn't free effect, EVIOCRMFF ioctl failed: %d %s\n", errno, strerror(errno));
+ impl->effect_ids[i] = -1;
+ }
+ return STATUS_SUCCESS;
+ case PID_USAGE_DC_DEVICE_PAUSE:
+ WARN("device pause not supported\n");
+ return STATUS_NOT_SUPPORTED;
+ case PID_USAGE_DC_DEVICE_CONTINUE:
+ WARN("device continue not supported\n");
+ return STATUS_NOT_SUPPORTED;
+ }
+
+ return STATUS_NOT_SUPPORTED;
}
static const struct hid_device_vtbl lnxev_device_vtbl =
--
2.33.0
Oct. 1, 2021