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
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
  • 2
  • 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
  • 2
  • 15
0
votes
1 answer

how to persist or re-use impersonate token in windows?

I'm using Dependency: implementation group: "net.java.dev.jna", name: "jna" Code: PointerByReference phToken = new PointerByReference(); advapi32.LogonUserW(new WString(username), new WString(domain), new WString(password), 3, 0, phToken); Now i…
Ravi Soni
  • 953
  • 1
  • 7
  • 17
0
votes
0 answers

Setting a thread security descriptor to "block" OpenThread

First argument of OpenThread is dwDesiredAccess. I've read here that this argument is checked against the security descriptor of the thread. I tried setting it with SetSecurityInfo, but when i use OpenThread, it doesn't seem to work as expected for…
897uiaua8
  • 23
  • 2
0
votes
1 answer

why my impersonation a specific user code is throwing error

We are developing a ASP.NET web application in which we need to access a shared drive and search for a directory, if it is present or not. But while accessing using the PATH the application is showing error. For that case we thought to use…
0
votes
0 answers

How can I encrypt a file in C# using advapi32?

I need to encrypt a file in C# using the same process demonstrated in the following Microsoft example doc (but I need SHA instead of MD5). https://learn.microsoft.com/en-us/windows/win32/seccrypto/example-c-program-encrypting-a-file I found this…
Rick
  • 421
  • 3
  • 15
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
  • 467
  • 5
  • 16
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
  • 83
  • 8
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
  • 55
  • 1
  • 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,484
  • 3
  • 27
  • 48
0
votes
1 answer

How to enumerate all SIDs to which a specified user privilege has been assigned? c++

I am on Windows and C ++ I would like to recover all SIDs for a given privilege. To recover the SIDs I used the following methods : LsaOpenPolicy, LsaEnumerateAccountsWithUserRight and ConvertSidToStringSidA. The problem comes from the…
user8632386
0
votes
2 answers

Identifying the ENCRYPTION ALGORITHM used in advapi32.dll

How to find which encryption is used in the following vb code As far as i understood it is using MD5 to hash the given key MD5's result is obtained. then use the resulting value as key for RC4 algorithm The problem is i am not getting the same…
Minato
  • 56
  • 8
0
votes
0 answers

Get original username of person launching MS Access if using remoteapp and runas other user

I would like to get the username in VBA of the person who launched the RemoteApp MS Access application. I have set it up to have everyone log into the application using a service account (called "svcactuser") so that Access/SQL Server can manage the…
Conrad Addo
  • 424
  • 1
  • 5
  • 15