LsaManageSidNameMapping function

The LsaManageSidNameMapping function adds or removes SID/name mappings from the mapping set registered with the LSA Lookup Service.

Syntax

void WINAPI LsaManageSidNameMapping(
  _In_  LSA_SID_NAME_MAPPING_OPERATION_TYPE    OpType,
  _In_  PLSA_SID_NAME_MAPPING_OPERATION_INPUT  OpInput,
  _Out_ PLSA_SID_NAME_MAPPING_OPERATION_OUTPUT *OpOutput
);

Parameters

  • OpType [in]
    Indicates if a this function is being called to add or remove an SID/name mapping.

  • OpInput [in]
    Indicates the ___domain, account, and SID values to use during this operation. Additional flags can also be set within this structure.

  • OpOutput [out]
    Contains a value of LSA_SID_NAME_MAPPING_OPERATION_ERROR that indicates operation success or failure.

    Value Meaning
    Success

    Operation is complete without error.

    NonMappingError

    An error unrelated to SID-name mapping has occurred.

    NameCollision

    Operation failure due to name collision.

    SidCollision

    Operation failure due to SID collision.

    DomainNotFound

    Corresponding ___domain not found.

    DomainSidPrefixMismatch

    Provided SID doesn't have the correct ___domain prefix.

    MappingNotFound

    Mapping not found in the cache.

     

Return value

If the mapping is inserted successfully, the return value is STATUS_SUCCESS. Otherwise, if the function fails due to SID or name conflicts, STATUS_INVALID_PARAMETER error will be returned.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecapi.h

Library

Secur32.lib

DLL

Secur32.dll