Re: [python-win32] 8G USB sector number

2012-08-09 Thread Jane Chen
My bad. I should use 'Q' instead of 'LL'. Thank you Tim! Jane Jane Chen wrote: > Hi all, > I would like to get total sector number of my disk. However, I found that I > cannot get 8G sectors because of the buffer size. >  I only g

[python-win32] 8G USB sector number

2012-08-08 Thread Jane Chen
Hi all, I would like to get total sector number of my disk. However, I found that I cannot get 8G sectors because of the buffer size. I only got 4G. buf_fmt='LL' buf_size=struct.calcsize(buf_fmt) buf=win32file.DeviceIoControl(h, winioctlcon.IOCTL_DISK_GET_LENGTH_INFO, None, buf_size, None) Cou

Re: [python-win32] creating disk image

2012-08-08 Thread Jane Chen
Cool. Thank you Tim! Jane Chen wrote: > Thank you for your help, Roger and Tim! > > Problem solved.  I realized that I can simplify my problem by > using win32file.ReadFile()to create a bin file. You don't even need to go that far.  There's nothing you can do with win32

Re: [python-win32] creating disk image

2012-08-06 Thread Jane Chen
Thank you for your help, Roger and Tim!  Problem solved.  I realized that I can simplify my problem by using win32file.ReadFile()to create a bin file. Thank you, Jane  --- There's a FileStream class in \win32com\server\util.py that creates an IStream connected to a

[python-win32] creating disk image

2012-08-02 Thread Jane Chen
Hi all, I would like to create disk image through SHCreateStreamOnFileEx,IStream::Read, and IStream::Write. However, I cannot find these API in python-win32. I am wondering how to create disk image through python. Thank you, Jane___ python-win32 maili

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

2012-07-26 Thread Jane Chen
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

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

2012-07-23 Thread Jane Chen
tf("Failed to get ProtocolGUID, err code: %d",dwErr);         }  else{  printf("%s \n", pCmdBuf->ProtocolGUID);  }    delete [] pCmdBuf;  return 0;   } Thank you, Jane Jane Chen wrote: > Sorry. It's a mistake. However, I still get the same error message. > Maybe t

Re: [python-win32] python-win32 Digest, Vol 112, Issue 19

2012-07-23 Thread Jane Chen
      }  else{  printf("%s \n", pCmdBuf->ProtocolGUID);  }    delete [] pCmdBuf;  return 0;   } Thank you, Jane 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

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 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 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 <http://winioctlcon.py/>. You should not probably modify t

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

2012-07-17 Thread Jane Chen
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. IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL = CTL_CODE( FILE_DEVICE_DISK, 0x7a0, METHOD_BUFFERED, FILE_ANY_ACCESS) GUID_SFF_PROTOCO

[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

Re: [python-win32] ImportError: DLL load failed

2012-07-13 Thread Jane Chen
-packages\win32\ lib, and xx\python\lib\site-packages\Pythonwin.  Regards, Jane From: Mark Hammond To: Jane Chen Cc: "python-win32@python.org" Sent: Thursday, July 12, 2012 6:39 PM Subject: Re: [python-win32] ImportError: DLL load failed On 13/07/201

[python-win32] ImportError: DLL load failed

2012-07-12 Thread Jane Chen
Hi all, I would like to add python win32 to Portable Python distribution with PyGTK for Windows http://fnch.users.sourceforge.net/portablepygtkwindows.html  I installed the pywin32 in the python\Lib\site-packages folder. PC #1 can find win32api.pyd. After that, I copied the whole portable python