Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[LIBRARIES][SOURCE] WP8 Native Access project

OP GoodDayToDie

5th August 2013, 12:45 PM   |  #1  
OP Recognized Developer
Flag Seattle
Thanks Meter: 2,771
 
5,823 posts
Join Date:Joined: Jan 2011
More
This thread is for announcements and discussion around the WP8NativeAccess project (https://wp8nativeaccess.codeplex.com/). The purpose of this project is to provide general-purpose libraries, usable from C++ or .NET, which enable access to the underlying functions of the OS. In some cases, this will mean simple wrappers around native APIs; in other cases, these will be more advanced operations which simplify using the low-level APIs.

Some of the functions that the Native Access project exposes are already available via the official APIs. Other functions, however, are not. While I have no objection to these libraries being used in Store apps (license permitting), it is unlikely that Microsoft will permit the ones which use unofficial APIs.

Note that this library does not provide any method for elevation of privileges. Consequently, the use of these APIs will be constrained by the sandbox in which all third-party WP8 apps run, as defined by the capabilities in the app manifest. In practical terms, this means that most of the system will be either inaccessible or read-only. Even so, it has already proven useful to myself. When combined with interop-unlock and Capability-unlock hacks (making it possible for apps to obtain higher privileges), these APIs become much more useful. In fact, the EnableAllCapabilities utility uses the Registry library. Similarly, if you have the ability to use restricted Capabilities in an app you are developing, you may find these libraries useful.

The libraries are as follows:
  • FileSystem version 0.4.0: Implements functionality to read, write, and get information about files and directories, plus supports creating symbolic links and enumerating file system volumes. This version contains a breaking change from 0.3.x: the NativeFileSystem functions are now static and the constructor is removed. This library may be built with or without the macro USE_NON_PUBLIC_APIS; by default it now includes this macro and require kernelbase.lib to build. If this macro is not defined, it builds using the public APIs without requiring any special libraries.
  • Registry version 0.2.9: Implements functionality to read and write registry values, and to create and delete registry keys and values. Many, though not yet all, registry value types are fully supported. This library consists entirely of non-public (for WP8) APIs and requires the KERNELBASE.LIB and ADVAPI32LEGACY.LIB export libraries for Windows Phone 8 in order to build (the DLLs are in C:\Windows\System32 on the phone; you can use Dll2Lib.exe to extract the .LIB files).
  • Processes version 0.1.0: Implements basic functionality to get information about your process, and to create or kill a child process. Very early version.
They are licensed under the Microsoft Permissive License.

The FileSystem and Registry libraries are currently being used by my WP8 File Access Webserver project (http://forum.xda-developers.com/show....php?t=2355034).
My EnableAllSideloading app uses the Registry library (http://forum.xda-developers.com/show....php?t=2435697).
@hjc4869 has a basic FileExplorer app which uses the FileSystem library (http://forum.xda-developers.com/show....php?t=2497788).

You may need to use 7-Zip or another extraction program better than the built-in Windows Zip extractor to open the archive.
Attached Files
File Type: zip Registry_0_1_1.zip - [Click for QR Code] (11.8 KB, 1165 views)
File Type: zip NativeAccessLibraries_040_029_010.zip - [Click for QR Code] (76.4 KB, 998 views)
Last edited by GoodDayToDie; 29th October 2013 at 05:50 AM. Reason: Updated versions, added Processes (0.4.0, 0.2.9, 0.1.0)
The Following 12 Users Say Thank You to GoodDayToDie For This Useful Post: [ View ]
5th August 2013, 12:45 PM   |  #2  
OP Recognized Developer
Flag Seattle
Thanks Meter: 2,771
 
5,823 posts
Join Date:Joined: Jan 2011
More
Reserved for OP...
The Following 2 Users Say Thank You to GoodDayToDie For This Useful Post: [ View ]
25th October 2013, 02:22 PM   |  #3  
OP Recognized Developer
Flag Seattle
Thanks Meter: 2,771
 
5,823 posts
Join Date:Joined: Jan 2011
More
Updated. This will be the main place on XDA for releases of the NativeAccess libraries going forward. Additionally, please report problems or make feature requests here.
The Following 2 Users Say Thank You to GoodDayToDie For This Useful Post: [ View ]
27th October 2013, 06:45 PM   |  #4  
Member
Flag Wuhan
Thanks Meter: 52
 
52 posts
Join Date:Joined: Jul 2012
Donate to Me
More
I think there should be some way to list all the volumes...
Perhaps windows runtime has provided an async win32 file API wrapper which has the same ability as win32 ones ,so I think undocumented file API and registry ,process and etc are more important.
28th October 2013, 11:35 PM   |  #5  
OP Recognized Developer
Flag Seattle
Thanks Meter: 2,771
 
5,823 posts
Join Date:Joined: Jan 2011
More
The latest version of the NativeFileSystem library can give you the mount points (as strings) for all volumes (C:\, D:\, etc.)... I implemented that a few days ago; it should be in this update. Sorry for not highlighting that more clearly (typo in the OP fixed now).
The Following User Says Thank You to GoodDayToDie For This Useful Post: [ View ]
28th October 2013, 11:50 PM   |  #6  
Senior Member
Flag PERPIGNAN
Thanks Meter: 103
 
513 posts
Join Date:Joined: Jun 2009
More
Can't open "NativeAccessLibraries_040_029_010.zip"

Edit Ok with 7-zip
Last edited by titi66200; 29th October 2013 at 12:08 AM.
29th October 2013, 05:49 AM   |  #7  
OP Recognized Developer
Flag Seattle
Thanks Meter: 2,771
 
5,823 posts
Join Date:Joined: Jan 2011
More
How odd, you're right. I didn't do anything terribly fancy while building that ZIP, so I really don't know what's up with that.
2nd November 2013, 07:25 PM   |  #8  
contable's Avatar
Senior Member
Thanks Meter: 956
 
1,692 posts
Join Date:Joined: Oct 2009
Donate to Me
I have added the NativeFileSystem library to my PDF to Office app...

Thanks again for all your work !
The Following 4 Users Say Thank You to contable For This Useful Post: [ View ]
23rd April 2014, 01:51 PM   |  #9  
myst02's Avatar
Senior Member
Thanks Meter: 108
 
155 posts
Join Date:Joined: Feb 2014
More
@GoodDayToDie: Congratulations, good work! Unfortunately I can't import the registry library, it says it's not a valid DLL. I have Visual Studio 2013 Pro. Does it work for WP8? Please help me solving the problem. Thanks!


Sent from my Windows Phone using Tapatalk
23rd April 2014, 06:02 PM   |  #10  
Member
Thanks Meter: 37
 
71 posts
Join Date:Joined: Aug 2013
Quote:
Originally Posted by myst02

@GoodDayToDie: Congratulations, good work! Unfortunately I can't import the registry library, it says it's not a valid DLL. I have Visual Studio 2013 Pro. Does it work for WP8? Please help me solving the problem. Thanks!


Sent from my Windows Phone using Tapatalk

You need to reference .winmd file, not the .dll file.

The Following User Says Thank You to Sunius1 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes