After quietly working on it for several months, the project has now reached a point where I feel
comfortable to make it public:
WPDLib is a dynamic link library (DLL) to access devices via the Windows Portable Devices (WPD) API. Written in C++ and for the Microsoft Windows platform; published under the terms of the MIT license.
It can connect to devices that facilitate the Media Transport Protocol (MTP) or the Mass Storage Class (MSC) protocol: Many Android smartphones and other media players use the former; while most USB flash memory sticks and simple MP3 players use the latter.
Although it is still not completely done yet (or even polished enough for a first major release, thus the version number 0.1.0), the library can do what I had in mind at the beginning: Connecting to an MTP device (e.g. a smartphone) and copying files to it.
In fact, it’s already capable of more: Getting data about the device, creating (nested) folders, renaming files and folders, deleting objects, …
On the other hand, I doubt that this will ever evolve to an universal library for all uses; the main motivation was (and is) to enable another project of mine (RandFill) to work with devices like Android smartphones, which are using the Media Transport Protocol (MTP).
But since I’ve struggled from the start with learning how the WPD API works1 by scraping information from old articles, blog/forum posts and other open source code repositories, this might also be helpful other desperate souls like me 😄
The WPD API is seemingly not very popular: The most useful introductory texts stem from old Microsoft blogs, dating back to 2006-2008). ↩︎