This workaround is not required anymore, starting from version 1.1.0 of USBPhysic you don’t need to have your application elevated in Windows Vista or 7, no admin rights required anymore. Now it works even with a guest account type.
Issue:
Using USBPhysic to query hard drive physical data may fail sometimes on Vista / Windows 7 if UAC (User Account Control) is enabled and calling application is not launched with sufficient rights.
Workaround
To work around this issue without forcing the user to disable UAC mark your application with a requestedExecutionLevel. To do that you must create and embed an application manifest with your application that tells the operating system what the application needs ( digital signing of the EXE is also a good idea).
This is the format:
level="asInvoker|highestAvailable|requireAdministrator"
uiAccess="true|false"/>
To mark your application with a requestedExecutionLevel, first create an application manifest file to use with the target application. This file can be created by using any text editor. The application manifest file should have the same name as the target executable file with a .manifest extension. 4seohunt.com/www/rlbyte.com. For example: IsUserAdmin.exe.manifest.
Example:
Executable: MyApp.exe
Manifest: MyApp.exe.manifest
Sample application manifest file:
>
>
>
>
Next, you have to attach the application manifest to the executable by adding a line in the resource file of the application (the .rc file) to have Microsoft Visual Studio embed your manifest within the resource section of the PE file. To accomplish this, place the application manifest in the same directory as the source code for the project you are building and edit the resource file to include the following lines:
MANIFEST_RESOURCE_ID RT_MANIFEST "MyApp.exe.manifest"
After rebuild ing the application, the application manifest should be embedded in the resource section of the executable. Check your exe file with a resource viewer, you should see something like this: