[PATCH v4 7/20] winebus.sys: Add Linux udev bus

Aric Stewart aric at codeweavers.com
Wed Sep 7 14:22:42 CDT 2016



On 9/7/16 5:08 AM, Sebastian Lackner wrote:
> On 06.09.2016 17:14, Aric Stewart wrote:
>> v2: Style changes
>> v4: Updated with corrections from Thomas Faber
>>
>> Includes a common function to check if a bus is enabled and a base common
>> HID IRP_MJ_PNP handler
>>
>> Signed-off-by: Aric Stewart <aric at codeweavers.com>
>> ---
>>  dlls/winebus.sys/Makefile.in      |  5 ++-
.
.
.
>> +    if (check_bus_disabled(registry_path))
>> +    {
>> +        TRACE("UDEV plug and play bus disabled in registry\n");
>> +        return STATUS_SUCCESS;
> 
> Wouldn't it be better to return an error such that IoCreateDriver() fails?

No I personally don't think so.  We are successfully loading just disabled or not doing anything.

> 
>> +    }
>> +
>> +    return STATUS_SUCCESS;
>> +}
>> +
>> +#else
>> +
>> +NTSTATUS WINAPI udev_driver_init(DRIVER_OBJECT *driver, UNICODE_STRING *registry_path)
>> +{
>> +    TRACE("Dummy Linux udev Driver Init\n");
>> +    return STATUS_SUCCESS;
> 
> Similar to above, wouldn't it be better to return an error?

Same as above.

> 
>> +}
>> +
>> +#endif /* SONAME_LIBUDEV */
>> diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
>> index d495cd9..4690baf 100644
>> --- a/dlls/winebus.sys/main.c
>> +++ b/dlls/winebus.sys/main.c
>> @@ -28,11 +28,17 @@
>>  #include "ddk/wdm.h"
>>  #include "wine/debug.h"
>>  
>> +#include "bus.h"
>> +
>>  WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
>>  
>>  NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
>>  {
>> -    TRACE( "(%p, %s)\n", driver, debugstr_w(path->Buffer) );
>> +    static const WCHAR udevW[] = {'\\','D','r','i','v','e','r','\\','U','D','E','V',0};
>> +    static UNICODE_STRING udev = {sizeof(udevW) - sizeof(WCHAR), sizeof(udevW), (WCHAR*)udevW};
>> +
>> +    TRACE( "Wine Platform Bus(%p, %s)\n", driver, debugstr_w(path->Buffer) );
>> +    IoCreateDriver(&udev, udev_driver_init);
>>  
>>      return STATUS_SUCCESS;
>>  }
>> diff --git a/loader/wine.inf.in b/loader/wine.inf.in
>> index 85dbef1..b595693 100644
>> --- a/loader/wine.inf.in
>> +++ b/loader/wine.inf.in
>> @@ -48,7 +48,8 @@ AddReg=\
>>      SessionMgr,\
>>      Tapi,\
>>      Timezones,\
>> -    LicenseInformation
>> +    LicenseInformation,\
>> +    PlatformBus
>>  
>>  [DefaultInstall.NT]
>>  RegisterDlls=RegisterDllsSection
>> @@ -73,7 +74,8 @@ AddReg=\
>>      Tapi,\
>>      Timezones,\
>>      VersionInfo,\
>> -    LicenseInformation
>> +    LicenseInformation,\
>> +    PlatformBus
>>  
>>  [DefaultInstall.ntamd64]
>>  RegisterDlls=RegisterDllsSection
>> @@ -100,7 +102,8 @@ AddReg=\
>>      Tapi,\
>>      Timezones,\
>>      VersionInfo.ntamd64,\
>> -    LicenseInformation
>> +    LicenseInformation,\
>> +    PlatformBus
>>  
>>  [Wow64Install]
>>  RegisterDlls=RegisterDllsSection
>> @@ -115,7 +118,8 @@ AddReg=\
>>      Misc,\
>>      Tapi,\
>>      VersionInfo.ntamd64,\
>> -    LicenseInformation
>> +    LicenseInformation,\
>> +    PlatformBus
>>  
>>  [DefaultInstall.Services]
>>  AddService=BITS,0,BITSService
>> @@ -3397,3 +3401,6 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Shanghai-EnableGame",0x1
>>  HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x10001,0x00000001
>>  HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001
>>  HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001
>> +
>> +[PlatformBus]
>> +HKLM,System\CurrentControlSet\Services\UDEV,"Disabled",0x10001,0x00000000
>>
>>
>>
> 



More information about the wine-devel mailing list