http://bugs.winehq.org/show_bug.cgi?id=10018
--- Comment #44 from Anastasius Focht focht@gmx.net 2008-01-17 12:12:14 --- Hello,
yes the recent disk device emulation changes (mountmgr) seem to please the adobe license manager (physicaldevice support).
Just not failing too early (opening logical and physical devices) seems to be the culprit. Though the license manager didn't get any disk related data in the end. Neither by querying disk controller config data (serial numbers) using SMART device ioctl and SPI SCSI passthrough methods nor by raw physical disk access.
For sake of completeness I post the interesting snippets/requests made by adobe license manager and some explanations...
--- snip --- 0021:Call KERNEL32.CreateFileA(6145291c "\\.\c:",80000000,00000003,00000000,00000003,00000000,00000000) ret=0040341b 0021:Ret KERNEL32.CreateFileA() retval=0000005c ret=0040341b 0021:Call KERNEL32.DeviceIoControl(0000005c,002d1080,00000000,00000000,61452910,0000000c,61452930,00000000) ret=0040343b 0021:trace:cdrom:CDROM_DeviceIoControl 0x5c IOCTL_STORAGE_GET_DEVICE_NUMBER (nil) 0 0x61452910 12 0x61452820 0021:Ret KERNEL32.DeviceIoControl() retval=00000001 ret=0040343b --- snip ---
First it uses IOCTL_STORAGE_GET_DEVICE_NUMBER query to get physical drive number from logical device (and DeviceType == FILE_DEVICE_DISK), which is later used for "\\.\PhysicalDrive%d" stuff.
--- snip --- 0022:Call KERNEL32.CreateFileA(61562984 "\\.\c:",c0000000,00000003,00000000,00000003,00000000,00000000) ret=0040398a 0022:Ret KERNEL32.CreateFileA() retval=000000c0 ret=0040398a 0022:Call KERNEL32.DeviceIoControl(000000c0,00074080,00000000,00000000,61562948,00000018,61562964,00000000) ret=00403782 0022:trace:cdrom:CDROM_DeviceIoControl 0xc0 IOCTL_CODE_74080 (nil) 0 0x61562948 24 0x61561c30 0022:Ret KERNEL32.DeviceIoControl() retval=00000000 ret=00403782 0022:Call KERNEL32.DeviceIoControl(000000c0,0004100c,61562964,00000006,61562768,000000df,61562958,00000000) ret=004035f7 0022:trace:cdrom:CDROM_DeviceIoControl 0xc0 IOCTL_SCSI_GET_INQUIRY_DATA 0x61562964 6 0x61562768 223 0x61562670 0022:Ret KERNEL32.DeviceIoControl() retval=00000000 ret=004035f7 0022:Call KERNEL32.CloseHandle(000000c0) ret=004039ba 0022:Ret KERNEL32.CloseHandle() retval=00000001 ret=004039ba --- snip ---
Standard S.M.A.R.T device ioctl and SPI SCSI passthrough methods fail.
--- snip --- 0022:Call KERNEL32.CreateFileA(61562918 "\\.\PHYSICALDRIVE0",c0000000,00000003,00000000,00000003,00000080,00000000) ret=004012fd 0022:Ret KERNEL32.CreateFileA() retval=00000080 ret=004012fd 0022:Call KERNEL32.DeviceIoControl(00000080,00070000,00000000,00000000,61562954,00000018,61562944,00000000) ret=00401343 0022:trace:cdrom:CDROM_DeviceIoControl 0x80 IOCTL_CODE_70000 (nil) 0 0x61562954 24 0x61562850 0022:Ret KERNEL32.DeviceIoControl() retval=00000001 ret=00401343 0022:Call ntdll.RtlAllocateHeap(00530000,00000000,00000230) ret=00404b77 0022:Ret ntdll.RtlAllocateHeap() retval=00532f78 ret=00404b77 0022:Call KERNEL32.SetFilePointer(00000080,00000000,61562904,00000000) ret=004013db 0022:Ret KERNEL32.SetFilePointer() retval=ffffffff ret=004013db 0022:Call KERNEL32.CloseHandle(00000080) ret=00401274 0022:Ret KERNEL32.CloseHandle() retval=00000001 ret=00401274 --- snip ---
Raw physical disk device open and certain ioctls now work due to recent changes. It queries disk device geometry by using IOCTL_DISK_GET_DRIVE_GEOMETRY ioctl (which returns fake data). The rather interesting aspect of this snippet is that the license manager tries to seek the physical disk device which obviously fails and it doesn't seem to harm. lDistLow = lDistHigh = 0; SetFilePointer( hPhysDisk, lDistLow, &lDistHigh, FILE_BEGIN);
The seek was in preparation to read physical sector (MBR) from disk. Yes, and there is actually code which writes physical sector to disk - which might succeed in windows. Looks like some signature into unused MBR area. Bad guys. Though I wonder how that stuff mixes with common windows antivirus products which usually detect alterations to MBR ;-)
Anyway, the issue seemed to have worked out well for linux.
Regards