CreateFile \\\\.\\x: non-root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, 

I have a usb data aquisition device interfaced by mass storage protocol. I open it like:

hEcgDrive=CreateFile("\\\\.\\g:",
	GENERIC_READ | GENERIC_WRITE,
	FILE_SHARE_READ | FILE_SHARE_WRITE,
	NULL,
	OPEN_EXISTING,
	FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING |
	FILE_FLAG_WRITE_THROUGH | FILE_FLAG_OVERLAPPED,
	NULL);

for communication I use

DeviceIoControl(hEcgDrive,
	IOCTL_SCSI_PASS_THROUGH_DIRECT,
....
with a 'custom' scsi operation code as wrapper.

On Wine-1.1.30. under UHU linux (2.6.23.9-1) the program can open the device only if run as root. If run as plain user,  CreateFile gives             ERROR_ACCESS_DENIED (5).

I also tried with FILE_ALL_ACCESS, no luck.

I would appreciate any experience shared to solve this access issue!

The device has a basic filesystem with a txt file, so it is mapped under dosdevices, ok.

And an other question:
is it possible to open "\\\\.\\PHYSICALDISK2, this way no filesystem is needed, and the user is not confused with the apperance of a new drive. Under windows I follow the later strategy with success!

Thank you,
Gyula






[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux