Problems accessing .NET equipment without logging in as an administrator

I had to integrate my own library, which interacts with a webcam in a .NET application. So I wrote a wrapper library with PInvoke calls and linked it to the main program:

driver.dll (C ++) + driver.wrapper.dll (.net 3.5) + Application (.net 3.5)

The problem is that this only works when logging in as a local administrator (oddly enough, even when working with administrator rights). I am not getting any specific error messages here, the driver library just returns 0 instead of 1.

When the native library is directly related to the application, however

driver.dll (C ++) + application (C ++)

it works well as an administrator and as a user. The operating system is Windows 7. What could be causing this behavior and how can I solve this problem?

Edit: The problem is caused by the library in use. Solved now.

+4
source share
2 answers

The problem was caused by the library used and is no longer relevant.

+1
source

One solution might be editing app.manifest

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> 

This will always run your application as an administrator.

+3
source

Source: https://habr.com/ru/post/1337948/


All Articles