NT API

NT API

Question:
I am trying to use the CreateProcessAsUser API function. If I put the declaration found in the win32api.txt, the program responds, “Can’t found DLL entry point” (Lib kernel32 function CreateProcessAsUserA).

Answer:
You didn’t give the declaration you are using, but the following should work:

' Constants used with CreationFlags in CreateProcessPrivate Const NORMAL_PRIORITY_CLASS As Long = &H20&Private Const HIGH_PRIORITY_CLASS As Long = &H80&Private Const IDLE_PRIORITY_CLASS As Long = &H40&Private Const REALTIME_PRIORITY_CLASS As Long = &H100&' Constants used with CreateProcessPrivate Const STARTF_USESHOWWINDOW As Long = &H1&Private Const STARTF_USESIZE As Long = &H2&Private Const STARTF_USEPOSITION As Long = &H4&Private Const STARTF_USECOUNTCHARS As Long = &H8&Private Const STARTF_USEFILLATTRIBUTE As Long = &H10&Private Const STARTF_RUNFULLSCREEN As Long = &H20&Private Const STARTF_FORCEONFEEDBACK As Long = &H40&Private Const STARTF_FORCEOFFFEEDBACK As Long = &H80&Private Const STARTF_USESTDHANDLES As Long = &H100&Private Const CREATE_SEPARATE_WOW_VDM As Long = &H800&' ShowWindow constantsPrivate Enum ShowWindow   SW_HIDE = 0&   SW_NORMAL = 1&   SW_SHOWNORMAL = 1&   SW_SHOWMINIMIZED = 2&   SW_MAXIMIZE = 3&   SW_SHOWMAXIMIZED = 3&   SW_SHOWNOACTIVATE = 4&   SW_SHOW = 5&   SW_MINIMIZE = 6&   SW_SHOWMINNOACTIVE = 7&   SW_SHOWNA = 8&   SW_RESTORE = 9&   SW_MAX = 10&   SW_SHOWDEFAULT = 10&End Enum' Structures used with CreateProcessPrivate Type STARTUPINFO   cb As Long   lpReserved As Long   lpDesktop As Long   lpTitle As Long   dwX As Long   dwY As Long   dwXSize As Long   dwYSize As Long   dwXCountChars As Long   dwYCountChars As Long   dwFillAttribute As Long   dwFlags As Long   wShowWindow As Integer   cbReserved2 As Integer   lpReserved2 As Long   hStdInput As Long   hStdOutput As Long   hStdError As LongEnd TypePrivate Type SECURITY_ATTRIBUTES   nLength As Long   lpSecurityDescriptor As Long   bInheritHandle As LongEnd TypePrivate Type PROCESS_INFORMATION   hProcess As Long   hThread As Long   dwProcessId As Long   dwThreadID As LongEnd TypePrivate Declare Function CreateProcessAsUser _   Lib "kernel32" Alias "CreateProcessAsUserA" _   (ByVal hToken As Long, _    ByVal lpApplicationName As String, _    ByVal lpCommandLine As String, _    ByVal lpProcessAttributes As Long, _    ByVal lpThreadAttributes As Long, _    ByVal bInheritHandles As Long, _    ByVal dwCreationFlags As Long, _    ByVal lpEnvironment As Long, _    ByVal lpCurrentDirectory As String, _    lpStartupInfo As STARTUPINFO, _    lpProcessInformation As PROCESS_INFORMATION) As LongPrivate Declare Function CloseHandle _   Lib "kernel32" _   (ByVal hObject As Long) As Long' API callsPrivate Declare Function LogonUser _   Lib "Advapi32" Alias "LogonUserA" _   (ByVal lpszUsername As String, _    ByVal lpszDomain As Any, _    ByVal lpszPassword As String, _    ByVal dwLogonType As Long, _    ByVal dwLogonProvider As Long, _    phToken As Long) As Long' Constants used by LogonUserPrivate Const LOGON32_PROVIDER_DEFAULT As Long = 0&Private Const LOGON32_PROVIDER_WINNT35 As Long = 1&Private Const LOGON32_LOGON_INTERACTIVE As Long = 2&Private Const LOGON32_LOGON_NETWORK As Long = 3&Private Const LOGON32_LOGON_BATCH As Long = 4&Private Const LOGON32_LOGON_SERVICE As Long = 5&

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as