From c8fe5b81dcf0ba64e2e76347bae4a7fbf7760742 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Sat, 23 Jul 2011 20:28:41 +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 | 14 +++- server/trace.c | 14 ++++ 6 files changed, 200 insertions(+), 5 deletions(-) diff --git a/configure b/configure index e8bc505..fb2ac4d 100755 --- a/configure +++ b/configure @@ -639,6 +639,8 @@ GPHOTO2INCL GPHOTO2LIBS gphoto2port_devel gphoto2_devel +USBINCL +USBLIBS SANEINCL sane_devel GNUTLSINCL @@ -801,6 +803,7 @@ with_png with_pthread with_sane with_tiff +with_usb with_v4l with_xcomposite with_xcursor @@ -1490,6 +1493,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 @@ -2673,6 +2677,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; @@ -9892,6 +9902,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 c405d64..1960286 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -213,7 +213,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 26528b7..1d15fb2 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -362,6 +362,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 @@ -1046,6 +1052,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 ee438b4..0bc6d18 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4610,6 +4610,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; data_size_t in_size; data_size_t out_size; @@ -4878,6 +4880,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, @@ -5127,6 +5142,7 @@ enum request REQ_set_cursor, REQ_get_suspend_context, REQ_set_suspend_context, + REQ_get_device_name, REQ_NB_REQUESTS }; @@ -5381,6 +5397,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 { @@ -5633,8 +5650,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 425 +#define SERVER_PROTOCOL_VERSION 426 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/request.h b/server/request.h index d2ca2f6..a3d96a1 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 ); @@ -2043,10 +2045,11 @@ 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, in_size) == 24 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 28 ); -C_ASSERT( sizeof(struct get_next_device_request_reply) == 32 ); +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, 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( 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 ); @@ -2134,6 +2137,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 37ea216..5a6f37d 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3728,6 +3728,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, ", in_size=%u", req->in_size ); fprintf( stderr, ", out_size=%u", req->out_size ); @@ -3903,6 +3904,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, @@ -4151,6 +4162,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] = { @@ -4401,6 +4413,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] = { @@ -4651,6 +4664,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.5.4