From f4fd39f0e0041e0603aeaece18b968ef895e9b6d Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Sun, 1 May 2011 00:01:38 +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 80f9d38..456381e 100755 --- a/configure +++ b/configure @@ -642,6 +642,8 @@ GPHOTO2INCL GPHOTO2LIBS gphoto2port_devel gphoto2_devel +USBINCL +USBLIBS SANEINCL sane_devel GNUTLSINCL @@ -809,6 +811,7 @@ with_png with_pthread with_sane with_tiff +with_usb with_v4l with_xcomposite with_xcursor @@ -1501,6 +1504,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 @@ -2702,6 +2706,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; @@ -10125,6 +10135,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 1155d30..1fb4225 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -207,7 +207,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 9e2866c..7e1678b 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -371,6 +371,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 @@ -1061,6 +1067,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 6fdae05..bb9705f 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4574,6 +4574,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; @@ -4815,6 +4817,19 @@ struct set_cursor_reply #define SET_CURSOR_CLIP 0x08 + +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, @@ -5060,6 +5075,7 @@ enum request REQ_alloc_user_handle, REQ_free_user_handle, REQ_set_cursor, + REQ_get_device_name, REQ_NB_REQUESTS }; @@ -5310,6 +5326,7 @@ union generic_request struct alloc_user_handle_request alloc_user_handle_request; struct free_user_handle_request free_user_handle_request; struct set_cursor_request set_cursor_request; + struct get_device_name_request get_device_name_request; }; union generic_reply { @@ -5558,8 +5575,9 @@ union generic_reply struct alloc_user_handle_reply alloc_user_handle_reply; struct free_user_handle_reply free_user_handle_reply; struct set_cursor_reply set_cursor_reply; + struct get_device_name_reply get_device_name_reply; }; -#define SERVER_PROTOCOL_VERSION 422 +#define SERVER_PROTOCOL_VERSION 423 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/request.h b/server/request.h index b08033e..6926d91 100644 --- a/server/request.h +++ b/server/request.h @@ -354,6 +354,7 @@ DECL_HANDLER(set_window_layered_info); DECL_HANDLER(alloc_user_handle); DECL_HANDLER(free_user_handle); DECL_HANDLER(set_cursor); +DECL_HANDLER(get_device_name); #ifdef WANT_REQUEST_HANDLERS @@ -603,6 +604,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_alloc_user_handle, (req_handler)req_free_user_handle, (req_handler)req_set_cursor, + (req_handler)req_get_device_name, }; C_ASSERT( sizeof(affinity_t) == 8 ); @@ -2020,10 +2022,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 ); @@ -2108,6 +2111,9 @@ C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_y) == 28 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_clip) == 32 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, last_change) == 48 ); C_ASSERT( sizeof(struct set_cursor_reply) == 56 ); +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 a296341..dd65965 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3701,6 +3701,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 ); @@ -3862,6 +3863,16 @@ static void dump_set_cursor_reply( const struct set_cursor_reply *req ) fprintf( stderr, ", last_change=%08x", req->last_change ); } +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, @@ -4106,6 +4117,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_alloc_user_handle_request, (dump_func)dump_free_user_handle_request, (dump_func)dump_set_cursor_request, + (dump_func)dump_get_device_name_request, }; static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { @@ -4352,6 +4364,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_alloc_user_handle_reply, NULL, (dump_func)dump_set_cursor_reply, + (dump_func)dump_get_device_name_reply, }; static const char * const req_names[REQ_NB_REQUESTS] = { @@ -4598,6 +4611,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "alloc_user_handle", "free_user_handle", "set_cursor", + "get_device_name", }; static const struct -- 1.7.4.5