Sign in
dimeby8
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
C#
Misc
MTP
WPD
Archive
Archives
November 2011
(1)
June 2009
(1)
May 2007
(1)
January 2007
(2)
December 2006
(9)
November 2006
(2)
October 2006
(14)
September 2006
(6)
August 2006
(6)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
dimeby8
Sample XML document for ProvisioningAgent.provisionFromXmlDocumentAsync()
Posted
over 2 years ago
by
Darene Lewis [MSFT]
1
Comments
Below is an example of a provisioning XML document that may be passed to the ProvisioningAgent.provisionFromXmlDocumentAsync method. The following fields need to be customized at the least - Issuer and Subscriber. The value for the Subscriber node must...
dimeby8
Change ‘Unidentified network’ from Public to Work in Windows 7
Posted
over 4 years ago
by
Darene Lewis [MSFT]
20
Comments
There isn’t an easy way to set the category of an Unidentified network in Windows 7 RC+ builds. By default, an Unidentified network will be set to Public for security. Often, the Unidentified network is setup intentionally (e.g. two machines connected...
dimeby8
Where is wpdmtpextensions.h?
Posted
over 6 years ago
by
Darene Lewis [MSFT]
0
Comments
The header file - Wpdmtpextensions.h - has been referenced in several of my posts and is needed to talk MTP to the device through WPD. The header file is not available in the Vista SDK/WDK or the WMP 11 SDK, but is planned for inclusion in the Windows...
dimeby8
Creating a WPD playlist object in C#
Posted
over 6 years ago
by
Darene Lewis [MSFT]
4
Comments
This is a C# follow-up post on the earlier C++ playlist creation post . Be sure to read the earlier post for background information on playlists and how it stores references. We will also re-use the StringToPropVariant helper function that we defined...
dimeby8
Creating WPD PROPVARIANTs in C# without using interop
Posted
over 6 years ago
by
Darene Lewis [MSFT]
3
Comments
Previous posts have covered how to create, manage and marshal PROPVARIANTs using interop. Here's a way on how to create a PROPVARIANT without interop. The IPortableDeviceValues interface exposes a SetStringValue method that allows a regular C# string...
dimeby8
Connecting to a WPD device in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
2
Comments
This is the C# equivalent of an earlier C++ post on connecting to a WPD device. We'll concentrate on the implementation here - you may refer back to that earlier post for further explanation. // Create our client information collection PortableDeviceApiLib...
dimeby8
Marshalling variant properties in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
3
Comments
This post is a continuation of the one covering WPD property retrieval in C# . That post explained how to marshal strings and the basic int properties. Handling other types such as VT_DATE and VT_BOOL is trickier so I'll try to cover them here. VT_DATE...
dimeby8
WPD Content Enumeration in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
0
Comments
WPD content enumeration in C# is pretty close to the C++ style. Here's a basic example that enumerates the object IDs of the objects present on the device. static void Enumerate( ref PortableDeviceApiLib.IPortableDeviceContent pContent, string parentID...
dimeby8
Setting WPD properties in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
0
Comments
Since setting a WPD property requires manipulating a PROPVARIANT structure through interop, we must make use of the marshalling rules we set in our last post . We'll take a look at a function that allows string properties to be set. static void SetStringValue...
dimeby8
WPD property retrieval in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
9
Comments
WPD property values are retrieved as PROPVARIANTs through the WPD API. Unfortunately there is no native support for PROPVARIANTs in C#. To correctly retrieve the property values (or anything that is in a PROPVARIANT) through the WPD API in C#, we must...
dimeby8
Where are the WPD property keys in C#?
Posted
over 7 years ago
by
Darene Lewis [MSFT]
4
Comments
If you followed the exercise from our first C# post , you must have noticed that the PortableDeviceApi and PortableDeviceTypes typelibs don't expose the WPD property keys such as WPD_OBJECT_ID, WPD_OBJECT_FORMAT, etc. This can be a major blocker since...
dimeby8
Flying Wiimotes
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
I just bought a Wii and it has totally changed my gamer attitude, and I wasn't even a gamer to start with. No more button mashing anymore - arm-swinging and flailing with some actual hand-eye coordination is what it's all about. Of course with all the...
dimeby8
Enumerating WPD devices in C#
Posted
over 7 years ago
by
Darene Lewis [MSFT]
15
Comments
Let's take a look at how we can enumerate WPD devices in C#. This post assumes that you already have a project set up using these instructions . (Update: You will also need to follow the disassembly/reassembly instructions below for this to work correctly...
dimeby8
C# and the WPD API
Posted
over 7 years ago
by
Darene Lewis [MSFT]
2
Comments
There currently is no managed/C# flavor of the WPD API. This, of course, doesn't mean that you are locked out from using the WPD API if you want to use C#. Since the API is a set of COM interfaces, we simply have to interop across from C#. Granted it...
dimeby8
Help! WPD API calls randomly fail with 0x800700AA (ERROR_BUSY)
Posted
over 7 years ago
by
Darene Lewis [MSFT]
2
Comments
If you notice your API calls are randomly failing with HRESULT_FROM_WIN32(ERROR_BUSY) / 0x800700AA / -2147024726, then it's likely that the device driver is indeed busy doing something else. It could be that WMP is syncing content to the device, or maybe...
dimeby8
Transferring playlists through WPD
Posted
over 7 years ago
by
Darene Lewis [MSFT]
2
Comments
A playlist (.WPL, .M3U, etc.) is a text file which contains a list of filenames. This list is the "playlist". So transferring the playlist should be easy right? Well, yes it is - if you just want to transfer it as a text file... However if you want...
dimeby8
Custom MTP formats in WPD
Posted
over 7 years ago
by
Darene Lewis [MSFT]
2
Comments
The list of supported WPD formats is available in MSDN here . But what if your MTP device supports a brand new format that isn't in the supported list? WPD does allow a way to reference custom/vendor extended formats. If you take a closer look at the...
dimeby8
MTP array properties (AINT*/AUINT*) in WPD
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
MTP allows for a wide range of array-based data types ranging from an array of bytes (AINT8/AUINT8) to an array of GUIDs (AINT128/AUINT128). Check out section 3.2.1 and 3.2.2 in the MTP specification for a complete list and definition. Unfortunately...
dimeby8
Accessing MTP vendor extended properties through WPD
Posted
over 7 years ago
by
Darene Lewis [MSFT]
0
Comments
Apart from the standard device and object properties defined in the MTP specification, device vendors are free to add their own properties. The codes for these properties must lie in the vendor-extension range as defined by the MTP spec in section 3.3...
dimeby8
Setting WPD properties
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
The IPortableDeviceProperties::SetValues API can be used to set WPD object properties. The documentation covers the API parameters as well, so we'll skip to the meatier sample. The SetValues API can be used to set multiple properties at the same time...
dimeby8
How to check if a WPD property can be modified
Posted
over 7 years ago
by
Darene Lewis [MSFT]
0
Comments
We'll create a little helper function that we can use to figure out if a WPD object property can be modified. All WPD object properties have attributes on them. The MSDN documentation provides a complete list of attributes here . We'll take a look at...
dimeby8
Sending MTP commands through WPD (Part 3 - data from device)
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
Let's use the GetDevicePropValue command (MTP spec - section D.2.21) to illustrate this. GetDevicePropValue takes one parameter - the device property code that we want to retrieve the current value for. We'll retrieve the BatteryLevel device property...
dimeby8
Sending MTP commands through WPD (Part 2 - data to the device)
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
We'll pick the SetDevicePropValue MTP command (MTP spec - section D.2.22) to illustrate this example. This command requires the device property code as a parameter. We'll try setting the DateTime property (MTP spec - section C.2.18). The DateTime property...
dimeby8
Save Often!
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
One of the problems of living on the cutting edge is that it tends to make you bleed. I have a post-RC1 Vista build on my main desktop. And I was impressed by the fact that I hadn't required a single reboot in over three weeks. I worked yesterday on putting...
dimeby8
Creating an MTP string
Posted
over 7 years ago
by
Darene Lewis [MSFT]
1
Comments
In some of our later examples, we'll have to send MTP strings to the device. MTP strings are defined in the MTP spec in section 3.2.3. Briefly, the first byte is the number of Unicode characters to follow (including the NULL terminator), the remaining...
Page 1 of 2 (42 items)
1
2