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

Jane Chen janechen_1979 at yahoo.com
Fri Jul 27 01:33:44 CEST 2012


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 card?

Thank you,

Jane

Jane Chen wrote:
> Thank you for your help! No luck so far.
>
> I wrote a C program and got the same results as python:

Support for this ioctl is sporadic.  It may simply be that your SD drive
doesn't support it.

> Win 7 Notebook (with SD card inserted directly i.e. no SD card
> reader) Error code: 1

ERROR_INVALID_FUNCTION.  There has to be an SD card reader somewhere.

> Win 7 Notebook (without SD card inserted at all) Error code: 6

ERROR_INVALID_HANDLE

> WinXP desktop (with USB stick but without SD card inserted at
> all) Error code: 50

ERROR_FILE_EXISTS?  Remember that a USB stick will never support this.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



------------------------------

Message: 3
Date: Tue, 24 Jul 2012 12:09:05 +1000
From: Mark Hammond <skippy.hammond at gmail.com>
To: "Fox, Michael K" <michael.k.fox at boeing.com>
Cc: "python-win32 at python.org" <python-win32 at python.org>
Subject: Re: [python-win32] Need data type identifiers
Message-ID: <500E03C1.4010706 at gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

All the other comments in this thread are correct, but one other thing 
you can do in recent pywin32 builds is to use win32com.client.VARIANT to 
override how a value is passed - search for 'win32com.client.VARIANT' in 
pywin32.chm for basic docs.

HTH,

Mark

On 21/07/2012 1:55 PM, Fox, Michael K wrote:
> We are having occasional difficulties when we need to pass an argument
> in-and-out of a COM method that we are calling in Python.  There is some
> magic in makepy that normally handles this for us but occasionally it
> fails because it somehow reads the typelib incorrectly and
> misunderstands the data type it must create.  Specifically, I have a C++
> method exposed to COM and it expects an empty SafeArray of two elements
> (double floats) to be passed as an argument.  That method revises the
> array, filling it with two values.  We have found that makepy assigns
> some sort of identifier to each data type.  For instance an array of
> strings is assigned (24584, 3)and an array of variants is assigned
> (24588, 3) as shown in the line of code below, taken from one of the
> wrappers created by Makepy.
>
> def*GetDirection*(/self/, oDirection=(0,0)):
>
> return/self/._ApplyTypes_(1611137025, 1, (24, 0), ((24588,3),),
> u/'GetDirection'/, None, oDirection)
>
> Occasionally pywin32 assigns the wrong identifier then the argument is
> cast as the wrong data type and an error is thrown.  We stumbled upon
> the correct identifier and when we corrected the identifier assigned by
> Makepy then we were able to call the method without throwing an error.
> Where can we find a list of these identifiers?
>
> *Mike Fox*
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>



------------------------------

_______________________________________________
python-win32 mailing list
python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32


End of python-win32 Digest, Vol 112, Issue 24
*********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120726/6f8943a0/attachment-0001.html>


More information about the python-win32 mailing list