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.

63 questions
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,489
  • 6
  • 16
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,555
  • 2
  • 19
  • 41
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-
  • 921
  • 5
  • 14
  • 20
1
vote
1 answer

Call Advapi32.dll native EventWrite function from C#?

I'm trying to use C# .Net to trigger Window's Service Trigger Events. Specifically, I'm trying to trigger this event so that the WebClient service is started from an unprivileged account. C:\>sc qtriggerinfo WebClient [SC] QueryServiceConfig2…
Petey B
  • 10,781
  • 22
  • 73
  • 101
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
1
vote
1 answer

Calling advapi.dll using Pinvoke: CryptDecrypt and CryptEncrypt unexpected behaviour

This is a follow up from this question. I am calling the WinAPI Cryptography functions from VB.net to ensure compatibility with a legacy product that shares the resulting data. The code functioned fine for many years however I have recently run into…
James Ferretti
  • 171
  • 1
  • 15
1
vote
1 answer

Using MS crypto library on server 2012 - CryptCreateHash error code 87: ERROR_INVALID_PARAMETER

I am attempting to host a web application on a new Windows server 2012 environment, however I am receiving an unprecidented error. This code has existed in our codebase for years and no problems have been experienced on any other platform. The code…
James Ferretti
  • 171
  • 1
  • 15
1
vote
1 answer

Which returned parameters do I need to free from GetNamedSecurityInfo API?

When I called GetNamedSecurityInfo API and it succeeded, the MSDN states that I need to call LocalFree on ppSecurityDescriptor, but what about ppDacl and ppSacl?
ahmd0
  • 14,832
  • 29
  • 117
  • 218
0
votes
1 answer

GetNamedSecurityInfo fails for registry key where GetSecurityInfo succeeds

I have a registry key ACL reading request like this: PACL dacl = NULL; PSECURITY_DESCRIPTOR secDesc = NULL; if (GetNamedSecurityInfoW(L"HKEY_CURRENT_USER\\SOFTWARE\\SomeSoftware\\SomeKey", SE_REGISTRY_KEY, DACL_SECURITY_INFORMATION, NULL, NULL,…
Phi
  • 415
  • 4
  • 14
0
votes
0 answers

Use MFC in a static library option in Visual Studio

I'm trying to link my code (a DLL project) against mbedtls library with "Use MFC in a Static Library" option (Project settings -> General -> Use of MFC) and getting "unresolved external symbol" errors (the functions are from advapi32.lib). If I add…
alexeik
  • 63
  • 7
0
votes
0 answers

Is there a temporary fix possible to compile successfully working ffmpeg for the windows 10 using MinGW?

Current ffmpeg depends on CryptAcquireContextW what was deprecated and now removed from Windows. It compiles fine, but on running it crashes with text: "ffmpeg procedure entry point CryptAcquireContextW could not be located in the dynamic link…
0
votes
0 answers

Is there a way to return the data from a registry key value

I'm working on a program whereby one of its functions is to remove a file on the hard drive referenced through a windows registry value. I've been using Advapi32Util for searching for the file, however I couldn't find any way to return the data…
0
votes
1 answer

Problem CreateProcessWithLogonW with Date Format Windows 10 v.1703

I have the following code, where I raise a process using other Windows credentials provided in an external source. Code: public static void ImpersonateProcess_WithProfile(string appPath, string domain, string user, string password) { …
Carlos Reyes
  • 45
  • 1
  • 7
0
votes
0 answers

Impersonation in C#.NET - Not able to Impersonate by LogonType 4 or 5

Below is piece of code that I am using. I am able to ogin using LogonType 9 and Provider as 0 (Default provider), but other Logon types like LogonType 4 or 5 is not working. My Windows Server version MS Windows Server 2016 and user have been added…
captainsac
  • 2,384
  • 2
  • 23
  • 47