API Reference Documentation

Comprehensive guides and reference for Microsoft APIs and services.

Windows API

CreateProcessW

BOOL CreateProcessW( LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation );

Creates a new process and its primary thread. The new process runs in the security context of the calling process.

Parameters

Name Type Description
lpApplicationName LPCWSTR The name of the module to be executed.
lpCommandLine LPWSTR The command line string.
lpProcessAttributes LPSECURITY_ATTRIBUTES Security attributes for the process object.
lpThreadAttributes LPSECURITY_ATTRIBUTES Security attributes for the primary thread object.
bInheritHandles BOOL Inheritance flag for handles.
dwCreationFlags DWORD Creation flags.
lpEnvironment LPVOID Environment block for the new process.
lpCurrentDirectory LPCWSTR Current directory for the new process.
lpStartupInfo LPSTARTUPINFOW Startup information for the new process.
lpProcessInformation LPPROCESS_INFORMATION Process and thread information.

Return Value

Nonzero if the function succeeds, zero otherwise.

RegOpenKeyExW

LONG RegOpenKeyExW( HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult );

Opens an existing key in the registry. If the key does not exist, the function does not create it.

Parameters

  • hKey: A handle to an open registry key.
  • lpSubKey: The name of the registry subkey to be opened.
  • ulOptions: Reserved; must be zero.
  • samDesired: A mask that specifies the desired access rights to the key.
  • phkResult: A pointer to a variable that receives a handle to the opened key.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h.

.NET Framework

System.String.IsNullOrEmpty

public static bool IsNullOrEmpty( string value );

Indicates whether the specified string is null or an empty string ("").

Parameters

  • value: The string to test.

Return Value

true if the value parameter is null or an empty string (""); otherwise, false.

Microsoft Graph API

GET /users/{id}

GET https://graph.microsoft.com/v1.0/users/{id}

Retrieve the properties of a specified user.

Request

  • Authorization: Bearer {token}

Response

A JSON object representing the user's properties.

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
  "id": "d14c5b1a-4b1c-4f8a-9c8a-1b1c4f8a9c8a",
  "displayName": "Adele Vance",
  "mail": "AdeleV@contoso.com",
  "userPrincipalName": "AdeleV@contoso.onmicrosoft.com"
  // ... other properties
}