wpd

Accessing MTP vendor extended properties through WPD

做~自己de王妃 提交于 2019-12-12 01:15:10
问题 I am using Windows Portable Device API to access some MTP devices. I want to read the vendor extended properties from the device, it should look something like this: "microsoft.com/WPDNA" or "microsoft.com/MTPZ" It seems like this should be a quite simple task but I cannot figure it out. I have been able to enumerate objects on a device and transfer files and so on, this was included in the WpdApiSample Application. I also found this article that I think is what I want to do. But I don't

How to get IPortableDeviceContent interface for given PIDL

纵饮孤独 提交于 2019-12-11 14:22:05
问题 I use SHBrowseForFolder() to select a folder on MTP device. Then I want to copy file from/to there. IPortableDeviceContent interface (from Windows Portable Devices SDK) seems suitable, but how to get it for the object with PIDL, returned from SHBrowseForFolder()? (I asked similar question about obtaining IWMDMStorageControl interface: How to get IWMDMStorageControl interface for given PIDL) 回答1: We can get the displayed name, associated with the PILD from SHBrowseForFolder() in this way:

shell32 copyhere not working neither in .Net nor powershell script

南笙酒味 提交于 2019-12-11 07:34:17
问题 There is a powershell script to copy files between pc and android via MTP programmatically,see access-file-system-against-mtp-connection,and it works when it running under powershell console,then i have made a script as below: function Usage() { echo "Usage:mtpcmd cp srcfile dstfolder" } function main { param($mainargs) # echo "args2:$mainargs" if(-not($mainargs.length -eq 2)) { Usage return } $srcfile=$mainargs[0] $dstfolder=$mainargs[1] $phone = Get-ChildShellItem | where { $_.Path -like '

Retrieve mount point of WPD device

做~自己de王妃 提交于 2019-12-11 03:15:09
问题 I've worked with WPD API for a while now, and I seem to run in to problem after problem. Once I fix one problem, something else pops up. But hey, that's life. I've been trying to determine if a WPD device is a storage device or a phone or whatever. Turns out, devices such as iPhone are not set to be recognized as a phone, but instead as a generic device in terms of WPD_DEVICE_TYPE . But, it is presented to Windows as a storage device. When connecting external harddrives, SD memory card

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

∥☆過路亽.° 提交于 2019-12-09 16:22:05
问题 I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a picture. I also need to transfer the picture to the computer and possibly delete it from the camera's storage. A bonus would be to get a live preview from the camera in my application. My environment will be Windows (either XP Pro or Vista Enterprise) and .Net 3.5 (C#). I have done some research and

Copy files with WPD to Windows Phone C#

断了今生、忘了曾经 提交于 2019-12-07 07:21:05
问题 I want to copy at least one file to a windows phone via MTP. I am able to connect to the phone and copy files from the phone to the computer following this tutorial: WPD: Transferring Content However I am unable to copy files the other way round (from computer to phone). This is my code: IPortableDeviceContent content; this._device.Content(out content); IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); PortableDeviceApiLib.IStream tempStream; uint

Copy files with WPD to Windows Phone C#

房东的猫 提交于 2019-12-05 12:50:26
I want to copy at least one file to a windows phone via MTP. I am able to connect to the phone and copy files from the phone to the computer following this tutorial: WPD: Transferring Content However I am unable to copy files the other way round (from computer to phone). This is my code: IPortableDeviceContent content; this._device.Content(out content); IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); PortableDeviceApiLib.IStream tempStream; uint optimalTransferSizeBytes = 0; content.CreateObjectWithPropertiesAndData( values, out tempStream, ref

System.AccessViolationException when copying data to portable device after installing windows 10 creators update 1703

℡╲_俬逩灬. 提交于 2019-12-05 11:18:54
I am attempting to transfer content to portable device using this code snippet IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); IStream tempStream; uint optimalTransferSizeBytes = 0; content.CreateObjectWithPropertiesAndData( values, out tempStream, ref optimalTransferSizeBytes, null); System.Runtime.InteropServices.ComTypes.IStream targetStream = (System.Runtime.InteropServices.ComTypes.IStream)tempStream; try { using (var sourceStream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { var buffer = new byte[optimalTransferSizeBytes]; int

WinAPI calls to access USB storage which has no drive letter?

点点圈 提交于 2019-12-04 04:45:13
I've noticed, that some USB storage devices don't register in Windows as regular drives, in that they don't even get assigned a drive letter. Therefore, I can't apparently access them using the standard file operations C API. What are the WinAPI calls I can use to do some normal file operations on those strange devices - so: find/enumerate those devices at all, browse the file/directory tree on the device and get some file stats (size, modification date, etc.), read/write contents of the files, create/delete files/directories? Also, what are the general keywords by which those kinds devices

Alternatives to WPD/WIA on Windows XP?

非 Y 不嫁゛ 提交于 2019-12-03 16:27:00
WPD does not work correctly on Windows XP (SP1 if that matters), even if Microsoft states it does . Problem with WPD: IPortableDeviceManager.GetDevices call does not find any devices on Win XP while it finds all connected cameras on Windows 7. A few other people had this same problem with WPD not working on XP, no solution: 1 2 I have decided to reimplement the functionality using WIA. Problem with WIA automation/WIA interfaces: WIA automation offers only silly dialogs when interacting with the camera - I need to rather do this from code Programming against WIA interfaces is recommended to