| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
December 29, 2014 module win32.winioctl :IOCTL_STORAGE_EJECT_MEDIA' Value is Error | ||||
|---|---|---|---|---|
| ||||
Now,I use the win32.winioctl.d file,find :IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it ,will get the error value 50.(by GetLastError()). It should be 0x2d4808.If you use it ,it works ok. Why have this kind of mistake? Frank | ||||
December 29, 2014 Re: module win32.winioctl :IOCTL_STORAGE_EJECT_MEDIA' Value is Error | ||||
|---|---|---|---|---|
| ||||
Posted in reply to FrankLike | Am 29.12.2014 um 13:00 schrieb FrankLike: > Now,I use the win32.winioctl.d file,find > :IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it ,will > get the error value 50.(by GetLastError()). > > It should be 0x2d4808.If you use it ,it works ok. > > Why have this kind of mistake? > > Frank > maybe just a bug but https://github.com/Diggsey/druntime-win32/blob/master/winioctl.d seems to be correctly defined IOCTL_STORAGE_EJECT_MEDIA = CTL_CODE_T!(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS), | |||
December 29, 2014 Re: module win32.winioctl :IOCTL_STORAGE_EJECT_MEDIA' Value is Error | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | On Monday, 29 December 2014 at 12:19:34 UTC, dennis luehring wrote:
> Am 29.12.2014 um 13:00 schrieb FrankLike:
>> Now,I use the win32.winioctl.d file,find
>> :IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it ,will
>> get the error value 50.(by GetLastError()).
>>
>> It should be 0x2d4808.If you use it ,it works ok.
>>
>> Why have this kind of mistake?
>>
>> Frank
>>
>
> maybe just a bug
>
> but https://github.com/Diggsey/druntime-win32/blob/master/winioctl.d seems to be correctly defined
>
> IOCTL_STORAGE_EJECT_MEDIA = CTL_CODE_T!(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS),
You can test to remove a USB by it,use '0x2d4808' will be ok,but '0x0202' will be failed .
| |||
December 30, 2014 Re: module win32.winioctl :IOCTL_STORAGE_EJECT_MEDIA' Value is Error | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | On Monday, 29 December 2014 at 12:19:34 UTC, dennis luehring wrote:
> Am 29.12.2014 um 13:00 schrieb FrankLike:
>> Now,I use the win32.winioctl.d file,find
>> :IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it ,will
>> get the error value 50.(by GetLastError()).
>>
>> It should be 0x2d4808.If you use it ,it works ok.
>>
>> Why have this kind of mistake?
>>
>> Frank
>>
>
> maybe just a bug
>
> but https://github.com/Diggsey/druntime-win32/blob/master/winioctl.d seems to be correctly defined
>
> IOCTL_STORAGE_EJECT_MEDIA = CTL_CODE_T!(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS),
Sorry,I've known what's wrong with it.
Should do similar to C++: import win32.winioctl;
Don't similar to c#: public uint IOCTL_STORAGE_EJECT_MEDIA = 0x2d4808;
| |||
December 30, 2014 Re: module win32.winioctl :IOCTL_STORAGE_EJECT_MEDIA' Value is Error | ||||
|---|---|---|---|---|
| ||||
Posted in reply to FrankLike | Am 30.12.2014 um 04:03 schrieb FrankLike:
> On Monday, 29 December 2014 at 12:19:34 UTC, dennis luehring
> wrote:
>> Am 29.12.2014 um 13:00 schrieb FrankLike:
>>> Now,I use the win32.winioctl.d file,find
>>> :IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it
>>> ,will
>>> get the error value 50.(by GetLastError()).
>>>
>>> It should be 0x2d4808.If you use it ,it works ok.
>>>
>>> Why have this kind of mistake?
>>>
>>> Frank
>>>
>>
>> maybe just a bug
>>
>> but
>> https://github.com/Diggsey/druntime-win32/blob/master/winioctl.d
>> seems to be correctly defined
>>
>> IOCTL_STORAGE_EJECT_MEDIA = CTL_CODE_T!(IOCTL_STORAGE_BASE,
>> 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS),
>
> Sorry,I've known what's wrong with it.
> Should do similar to C++: import win32.winioctl;
> Don't similar to c#: public uint IOCTL_STORAGE_EJECT_MEDIA =
> 0x2d4808;
>
so it was your fault not using the IOCTL_STORAGE_EJECT_MEDIA as defined in the import???? where do you get the 0x0202 value from????
your questions, problems AND solutions are always very hard to understand
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply