RtlGetPersistedStateLocation function (ntddk.h)

Retrieves the redirected location for the specified SourceID from the redirection map.

Syntax

NTSYSAPI NTSTATUS RtlGetPersistedStateLocation(
  [_In_]      PCWSTR              SourceID,
  [_In_opt_]  PCWSTR              CustomValue,
  [_In_opt_]  PCWSTR              DefaultPath,
  [_In_]      STATE_LOCATION_TYPE StateLocationType,
  [_In_]      PWCHAR              TargetPath,
  [_In_]      ULONG               BufferLengthIn,
  [_Out_opt_] PULONG              BufferLengthOut
);

Parameters

[_In_] SourceID

The identifier to lookup in the redirection map.

[_In_opt_] CustomValue

Optional. The value to retrieve, if it's different than the default value.

[_In_opt_] DefaultPath

Optional. If an entry for the SourceID value cannot be found in the map, returns this value.

[_In_] StateLocationType

A STATE_LOCATION_TYPE-type value that indicates the type of State to look up; registry or file system.

[_In_] TargetPath

A pointer to a Unicode string that receives the value. If the call is successful. The string is null-terminated.

[_In_] BufferLengthIn

The size of the string pointed to by TargetPath, in bytes.

[_Out_opt_] BufferLengthOut

Optional. If specified, returns the number of bytes written to the buffer in case the call is successful; number of bytes required if the call fails with the STATUS_BUFFER_OVERFLOW error code.

Return value

Returns an NTSTATUS value that indicates the success of failure of the operation. Otherwise returns an appropriate NTSTATUS value.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1803
Header ntddk.h
Library NtosKrnl.lib
DLL NtosKrnl.exe

See also

STATE_LOCATION_TYPE