Questions tagged [advapi32]

Anything related to MS Windows Advanced Services API for 32bit systems (part of Windows API), residing in the `advapi32.dll` library. This library provides functions to access Windows registry, to restart the system, to create Windows services and to manage user accounts.

Anything related to MS Windows Advanced Services API for 32bit systems (part of Windows API), residing in the advapi32.dll library. This library provides functions to access Windows registry, to restart the system, to create Windows services and to manage user accounts.

75 questions
1
vote
2 answers

Using RegSetKeySecurity to avoid registry redirection

In order to avoid registry redirection to Wow64 keys, how to translate the following code that uses Microsoft.Win32 APIs public void SetKeyAccessControl( RegistryKey rootKey, string subKeyName, string identity, …
kateroh
  • 4,382
  • 6
  • 43
  • 62
1
vote
0 answers

"Unable to find advapi32" error in logcat (in Unity android build)

I am currently making a connection to a MySql database. Everything goes well in the editor, connection is created and requests are sent correctly. But after creating a build for android, nothing works. I opened adb logcat to see what was going on…
TNXAH
  • 11
  • 2
1
vote
0 answers

PowerShell calling advapi32.dll GetEffectiveRightsFromAclA crashes PowerShell

My goal is: Get the effective rights for a file or directory without needing external modules like PowerShellAccessControl or NTFSSecurity from powershell gallery (I used both work on other systems without problems). Simply because the the owner of…
Joachim Otahal
  • 272
  • 2
  • 9
1
vote
1 answer

Get an application to run as a different user from a windows service

I have done a lot of research and not sure why this is not working, probably missing something simple. The code does start the program but it starts it as a local system user instead of as the intended user. Part of service that executes…
JW12689
  • 117
  • 1
  • 10
1
vote
2 answers

Check if another process has admin privileges

I have wrote a code to check is a process running on the same machine has administrator privileges or not. But it always returns false. Can you tell me what's wrong with it. private static bool HasAdminPrivileges(int processId) { var hProcess =…
1
vote
1 answer

Wincred not working properly with Git Bash(Git for Windows) when executing certain commands like "prune"

I have setup GitforWindows in my Windows 7 64Bit pretty well with Credential manager as "Wincred". Yet when I run some commands like git remote prune origin in GitBash, it gives following error in console, though runs the command: Failed to load…
Vicky Dev
  • 1,893
  • 2
  • 27
  • 62
1
vote
1 answer

C# Impersonate to Save on NAS drive not working

I've been trying to implement the impersonation on my c# application to save files on NAS drive, but even though my credentials are valid. I keep getting an error as The username or password is incorrect. it worked a couple of times and then it kept…
Isham
  • 37
  • 7
1
vote
0 answers

How do I refresh the environment variables in python after impersonating a user?

I have been working on allowing someone to impersonate a user, ( see: Access Violation in LogonUserW in Python 3 ) I have verified this as os.getlogin() returns a different user now, and file-access permissions behavior changed accordingly to the…
needoriginalname
  • 703
  • 3
  • 9
  • 27
1
vote
0 answers

Subscribe to Windows event log in Java

I am monitoring a folder for changes using java.nio.file.WatchService to see when a file is modified. What I also need is, when I get an ENTRY_MODIFIED event, to see who modified the file. For this I am trying to search the Windows Event Log. So…
pinpinokio
  • 505
  • 5
  • 19
1
vote
1 answer

How to use Windows API AuditEnumerateCategories function in PowerShell?

I want get the current Advanced Security Audit Policy using PowerShell. I could use auditpol.exe, but its ouput is different per OS language, which makes it difficult to parse. The settings are stored in a REG_NONE value in…
vrdse
  • 2,899
  • 10
  • 20
1
vote
2 answers

Installing Windows services on 64 bit systems using advapi32.dll

I want to install a service to Service Manager and run it. My code is as follows: using System; using System.Runtime.InteropServices; class Ana { static void Main() { IntPtr sc_handle=OpenSCManager(null,null,2); IntPtr…
1
vote
0 answers

Advapi32.lib missing from Visual Studio 2013 Community Edition

My code compiles and links just fine on PC #1 using VS 2013 Pro. It fails linking on PC #2 using VS 2013 Community Edition. The failure is three unresolved externals from Advapi32.lib -- CryptAcquireContextW, CryptReleaseContext, and…
Bungles
  • 1,969
  • 2
  • 25
  • 54
1
vote
1 answer

What is this (C/C++) program doing?

It's calling these API functions (advapi32.dll) with these parameters: CryptCreateHash ( 3275488, 32771, 0, 0, 1243424 ); CryptHashData ( 3203040, 'UY30930037661', 13, 0 ); CryptCreateHash ( 3276304, 32771, 0, 0, 46463812 ); CryptHashData (…
guitar-
  • 1,051
  • 5
  • 15
  • 21
1
vote
1 answer

C# PInvoke CryptImportKey Fails with "Invalid type specified"

I'm trying to use the CryptImportKey function to import a PFX into a Gemalto .NET IDPrime smart cart, but I'm getting a "Invalid Type Specified" (2148073482) error. I suspect that the RSACryptoServiceProvider.ExportCspBlob(true) call is returning…
RashadRivera
  • 793
  • 10
  • 17
1
vote
3 answers

RegEnumKeyEx - Access violation writing location

The situation: Need to fetch a list of all subkeys of a particular registry key. Need to access both 32bit and 64bit software keys, so I cannot use the Registry namespace. Using CSharp in .Net 3.5, and registry functionality from advapi32.dll I…
user3481980