Kernel32GetApplicationRestartSettings Method

Retrieves the restart information registered for the specified process.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static HResult GetApplicationRestartSettings(
	IntPtr hProcess,
	StringBuilder commandline,
	ref uint refCommandlineSize,
	out ApplicationRestartFlags refFlags
)

Parameters

hProcess  IntPtr
A handle to the process. This handle must have the VirtualMemoryRead access right.
commandline  StringBuilder
A pointer to a buffer that receives the restart command line specified by the application when it called the RegisterApplicationRestart(String, ApplicationRestartFlags) function.

The maximum size of the command line, in characters, is RESTART_MAX_CMD_LINE. Can be NULL if refCommandlineSize is zero.

refCommandlineSize  UInt32
On input, specifies the size of the commandline buffer, in characters.

If the buffer is not large enough to receive the command line, the function fails with HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) and sets this parameter to the required buffer size, in characters.

On output, specifies the size of the buffer that was used.

To determine the required buffer size, set commandline to NULL and this parameter to zero. The size includes one for the null-terminator character.

Note that the function returns S_OK, not HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) in this case.

refFlags  ApplicationRestartFlags
A pointer to a variable that receives the flags specified by the application when it called the RegisterApplicationRestart function.

Return Value

HResult
This function returns S_OK on success, or an HResult error code.

Remarks

See Also