From d51185c366e9e04cff4723dc3580a24fec8e87fe Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Sat, 17 Dec 2011 19:05:04 +0400 Subject: [PATCH 2/2] Re-generate some files. --- configure | 144 ++++++++++++++++++++++++++++++++++++++++ include/Makefile.in | 4 + include/config.h.in | 9 +++ include/wine/server_protocol.h | 20 +++++- server/request.h | 18 ++++-- server/trace.c | 14 ++++ 6 files changed, 202 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 712a6e4..de652dd 100755 --- a/configure +++ b/configure @@ -640,6 +640,8 @@ GPHOTO2INCL GPHOTO2LIBS gphoto2port_devel gphoto2_devel +USBINCL +USBLIBS SANEINCL sane_devel GNUTLSINCL @@ -804,6 +806,7 @@ with_png with_pthread with_sane with_tiff +with_usb with_v4l with_xcomposite with_xcursor @@ -1494,6 +1497,7 @@ Optional Packages: --without-pthread do not use the pthread library --without-sane do not use SANE (scanner support) --without-tiff do not use TIFF + --without-usb do not use USB --without-v4l do not use v4l1 (v4l support) --without-xcomposite do not use the Xcomposite extension --without-xcursor do not use the Xcursor extension @@ -2683,6 +2687,12 @@ if test "${with_tiff+set}" = set; then : fi +# Check whether --with-usb was given. +if test "${with_usb+set}" = set; then : + withval=$with_usb; +fi + + # Check whether --with-v4l was given. if test "${with_v4l+set}" = set; then : withval=$with_v4l; @@ -10012,6 +10022,140 @@ This is an error since --with-v4l was requested." "$LINENO" 5 ;; esac fi +USBLIBS="" + +USBINCL="" + +if test "x$with_usb" != "xno" +then + for ac_header in usb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default" +if test "x$ac_cv_header_usb_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_USB_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_init in -lusb" >&5 +$as_echo_n "checking for usb_init in -lusb... " >&6; } +if ${ac_cv_lib_usb_usb_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_init (); +int +main () +{ +return usb_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_init=yes +else + ac_cv_lib_usb_usb_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_init" >&5 +$as_echo "$ac_cv_lib_usb_usb_init" >&6; } +if test "x$ac_cv_lib_usb_usb_init" = xyes; then : + +$as_echo "#define HAVE_LIBUSB 1" >>confdefs.h + + USBLIBS="-lusb" +fi + +fi + +done + + ac_save_CPPFLAGS="$CPPFLAGS" + if test "$PKG_CONFIG" != "false" + then + ac_usb_incl="`$PKG_CONFIG --cflags libusb-1.0`" + ac_usb_libs="`$PKG_CONFIG --libs libusb-1.0`" + CPPFLAGS="$ac_usb_incl $CPPFLAGS" + fi + for ac_header in libusb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default" +if test "x$ac_cv_header_libusb_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUSB_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb_init in -lusb-1.0" >&5 +$as_echo_n "checking for libusb_init in -lusb-1.0... " >&6; } +if ${ac_cv_lib_usb_1_0_libusb_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb-1.0 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libusb_init (); +int +main () +{ +return libusb_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_1_0_libusb_init=yes +else + ac_cv_lib_usb_1_0_libusb_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_1_0_libusb_init" >&5 +$as_echo "$ac_cv_lib_usb_1_0_libusb_init" >&6; } +if test "x$ac_cv_lib_usb_1_0_libusb_init" = xyes; then : + +$as_echo "#define HAVE_LIBUSB 1" >>confdefs.h + + USBLIBS="$ac_usb_libs" + USBINCL="$ac_usb_incl" +fi + +fi + +done + + CPPFLAGS="$ac_save_CPPFLAGS" +fi +if test "x$ac_cv_lib_usb_usb_init" != "xyes" -a "x$ac_cv_lib_usb_1_0_libusb_init" != "xyes"; then : + case "x$with_usb" in + x) as_fn_append wine_notices "|libusb ${notice_platform}development files not found, USB won't be supported." ;; + xno) ;; + *) as_fn_error $? "libusb ${notice_platform}development files not found, USB won't be supported. +This is an error since --with-usb was requested." "$LINENO" 5 ;; +esac +fi + + if test "x$with_gphoto" != "xno" then ac_save_CPPFLAGS="$CPPFLAGS" diff --git a/include/Makefile.in b/include/Makefile.in index 2d139e4..818f17e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -217,7 +217,11 @@ SRCDIR_INCLUDES = \ ddk/usb100.h \ ddk/usb200.h \ ddk/usbdlib.h \ + ddk/usbdrivr.h \ + ddk/usbioctl.h \ + ddk/usbiodef.h \ ddk/wdm.h \ + ddk/wdmguid.h \ ddk/winddiui.h \ ddk/winsplp.h \ ddraw.h \ diff --git a/include/config.h.in b/include/config.h.in index 34c6db4..364c101 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -356,6 +356,12 @@ /* Define to 1 if you have the `ossaudio' library (-lossaudio). */ #undef HAVE_LIBOSSAUDIO +/* Define if you have the libusb library and header */ +#undef HAVE_LIBUSB + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUSB_H + /* Define if you have the libxml2 library */ #undef HAVE_LIBXML2 @@ -1040,6 +1046,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_USB_H + /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 5880b47..eca116b 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4613,6 +4613,8 @@ struct get_next_device_request_reply struct reply_header __header; obj_handle_t next; ioctl_code_t code; + process_id_t pid; + char __pad_20[4]; client_ptr_t user_ptr; process_id_t client_pid; thread_id_t client_tid; @@ -4883,6 +4885,19 @@ struct set_suspend_context_reply }; + +struct get_device_name_request +{ + struct request_header __header; + obj_handle_t handle; +}; +struct get_device_name_reply +{ + struct reply_header __header; + /* VARARG(name,unicode_str); */ +}; + + enum request { REQ_new_process, @@ -5132,6 +5147,7 @@ enum request REQ_set_cursor, REQ_get_suspend_context, REQ_set_suspend_context, + REQ_get_device_name, REQ_NB_REQUESTS }; @@ -5386,6 +5402,7 @@ union generic_request struct set_cursor_request set_cursor_request; struct get_suspend_context_request get_suspend_context_request; struct set_suspend_context_request set_suspend_context_request; + struct get_device_name_request get_device_name_request; }; union generic_reply { @@ -5638,8 +5655,9 @@ union generic_reply struct set_cursor_reply set_cursor_reply; struct get_suspend_context_reply get_suspend_context_reply; struct set_suspend_context_reply set_suspend_context_reply; + struct get_device_name_reply get_device_name_reply; }; -#define SERVER_PROTOCOL_VERSION 429 +#define SERVER_PROTOCOL_VERSION 430 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/request.h b/server/request.h index ac69461..f223ab4 100644 --- a/server/request.h +++ b/server/request.h @@ -358,6 +358,7 @@ DECL_HANDLER(free_user_handle); DECL_HANDLER(set_cursor); DECL_HANDLER(get_suspend_context); DECL_HANDLER(set_suspend_context); +DECL_HANDLER(get_device_name); #ifdef WANT_REQUEST_HANDLERS @@ -611,6 +612,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_set_cursor, (req_handler)req_get_suspend_context, (req_handler)req_set_suspend_context, + (req_handler)req_get_device_name, }; C_ASSERT( sizeof(affinity_t) == 8 ); @@ -2045,12 +2047,13 @@ C_ASSERT( FIELD_OFFSET(struct get_next_device_request_request, status) == 20 ); C_ASSERT( sizeof(struct get_next_device_request_request) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, next) == 8 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, code) == 12 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, user_ptr) == 16 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_pid) == 24 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_tid) == 28 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 32 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 36 ); -C_ASSERT( sizeof(struct get_next_device_request_reply) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, pid) == 16 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, user_ptr) == 24 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_pid) == 32 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_tid) == 36 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 44 ); +C_ASSERT( sizeof(struct get_next_device_request_reply) == 48 ); C_ASSERT( sizeof(struct make_process_system_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct make_process_system_reply, event) == 8 ); C_ASSERT( sizeof(struct make_process_system_reply) == 16 ); @@ -2138,6 +2141,9 @@ C_ASSERT( sizeof(struct set_cursor_reply) == 56 ); C_ASSERT( sizeof(struct get_suspend_context_request) == 16 ); C_ASSERT( sizeof(struct get_suspend_context_reply) == 8 ); C_ASSERT( sizeof(struct set_suspend_context_request) == 16 ); +C_ASSERT( FIELD_OFFSET(struct get_device_name_request, handle) == 12 ); +C_ASSERT( sizeof(struct get_device_name_request) == 16 ); +C_ASSERT( sizeof(struct get_device_name_reply) == 8 ); #endif /* WANT_REQUEST_HANDLERS */ diff --git a/server/trace.c b/server/trace.c index 4a50232..b593a51 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3731,6 +3731,7 @@ static void dump_get_next_device_request_reply( const struct get_next_device_req { fprintf( stderr, " next=%04x", req->next ); dump_ioctl_code( ", code=", &req->code ); + fprintf( stderr, ", pid=%04x", req->pid ); dump_uint64( ", user_ptr=", &req->user_ptr ); fprintf( stderr, ", client_pid=%04x", req->client_pid ); fprintf( stderr, ", client_tid=%04x", req->client_tid ); @@ -3908,6 +3909,16 @@ static void dump_set_suspend_context_request( const struct set_suspend_context_r dump_varargs_context( " context=", cur_size ); } +static void dump_get_device_name_request( const struct get_device_name_request *req ) +{ + fprintf( stderr, " handle=%04x", req->handle ); +} + +static void dump_get_device_name_reply( const struct get_device_name_reply *req ) +{ + dump_varargs_unicode_str( " name=", cur_size ); +} + static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_new_process_request, (dump_func)dump_get_new_process_info_request, @@ -4156,6 +4167,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_set_cursor_request, (dump_func)dump_get_suspend_context_request, (dump_func)dump_set_suspend_context_request, + (dump_func)dump_get_device_name_request, }; static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { @@ -4406,6 +4418,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_set_cursor_reply, (dump_func)dump_get_suspend_context_reply, NULL, + (dump_func)dump_get_device_name_reply, }; static const char * const req_names[REQ_NB_REQUESTS] = { @@ -4656,6 +4669,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "set_cursor", "get_suspend_context", "set_suspend_context", + "get_device_name", }; static const struct -- 1.7.6.4