Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-27 Thread Tim Roberts
Jane Chen wrote: > How can I know if my SD drive support the ioctl? I tested > IOCTL_SFFDISK_DEVICE_COMMAND and it worked (did not get any errors.) > However, IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL is not working. Well, frankly, if the volume driver rejects the ioctl, then it probably isn't supported

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-26 Thread Jane Chen
How can I know if my SD drive support the ioctl? I tested IOCTL_SFFDISK_DEVICE_COMMAND and it worked (did not get any errors.) However, IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL is not working. If IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL is not supported, do you know other ways to tell if the device is SD

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-23 Thread Jane Chen
Sorry! I forgot to change the subject in the previous email. Thank you for your help! No luck so far. I wrote a C program and got the same results as python: Win 7 Notebook (with SD card inserted directly i.e. no SD card reader) Error code: 1 Win 7 Notebook (without SD card inserted at all) Err

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Tim Roberts
Jane Chen wrote: > Sorry. It's a mistake. However, I still get the same error message. > Maybe there is another mistake. :( > Is there any tool for debugging purpose? What I would do is write the code as a C program just to make sure the API does what I expect. That at least eliminates the Python

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Jane Chen
Sorry. It's a mistake. However, I still get the same error message. Maybe there is another mistake. :( Is there any tool for debugging purpose?  Thank you, Jane >                    drive=".\\"+drive+'.' Why are you adding a dot?  That's a mistake.  You want  just ".\\E:" .  Remove the

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Tim Roberts
Jane Chen wrote: > I want my script to tell if the removable disk is an SD card or not, > so I wrote the following script. > > buf_fmt='HH' > buf_size=struct.calcsize(buf_fmt) > > drives = (drive for drive in win32api.GetLogicalDriveStrings ().split > ("\\\000") if drive) > for drive

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Jane Chen
I want my script to tell if the removable disk is an SD card or not, so I wrote the following script. buf_fmt='HH'   buf_size=struct.calcsize(buf_fmt) drives = (drive for drive in win32api.GetLogicalDriveStrings ().split ("\\\000") if drive)         for drive in drives:             if win32

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Tim Roberts
Jane Chen wrote: > > Thank you for your help. > Could you please help me write better codes for GUID? What are you going to do with it? You will get back a 20-byte string. The last 16-bytes are the binary GUID. The way you handle that depends on what you need to do with it. > You are right.

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-18 Thread Jane Chen
Jane Chen wrote: > > Thank you for your help. However, I still got pywintypes.error: (50, > "DeviceIoControl", "The request is not supported"). > >  I added the following codes to winioctlcon.py . You should not probably modify the standard library files, because you'll l

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-17 Thread Tim Roberts
Jane Chen wrote: > > Thank you for your help. However, I still got pywintypes.error: (50, > "DeviceIoControl", "The request is not supported"). > > I added the following codes to winioctlcon.py . You should not probably modify the standard library files, because you'll lo

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-17 Thread Jane Chen
ssage: 1 Date: Mon, 16 Jul 2012 21:54:03 -0400 From: "Roger Upole" To: python-win32@python.org Subject: Re: [python-win32] Does pywin32 support SD card     operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)? Message-ID: That one isn't in winioctlcon.py yet, but y

Re: [python-win32] Does pywin32 support SD card operation(IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-16 Thread Roger Upole
That one isn't in winioctlcon.py yet, but you should be able to define it relatively easily. According to the headers: #define IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL \ CTL_CODE( FILE_DEVICE_DISK, 0x7a0, METHOD_BUFFERED, FILE_ANY_ACCESS) You'll probably need to create the output buffer

[python-win32] Does pywin32 support SD card operation (IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?

2012-07-16 Thread Jane Chen
Hi All, Does pywin32 support SD card operation (IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL)?   I google IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL with Python. However, no useful information shows up.  My code: if win32file.DeviceIoControl(hVol, winioctlcon.IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL, 0, 6, 0): Er