Windows Dev Center

FwpmEngineGetSecurityInfo0 function

The FwpmEngineGetSecurityInfo0 function retrieves a copy of the security descriptor for the filter engine.

Syntax


DWORD WINAPI FwpmEngineGetSecurityInfo0(
  _In_      HANDLE               engineHandle,
  _In_      SECURITY_INFORMATION securityInfo,
  _Out_opt_ PSID                 *sidOwner,
  _Out_opt_ PSID                 *sidGroup,
  _Out_opt_ PACL                 *dacl,
  _Out_opt_ PACL                 *sacl,
  _Out_     PSECURITY_DESCRIPTOR *securityDescriptor
);

Parameters

engineHandle [in]

Type: HANDLE

Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.

securityInfo [in]

Type: SECURITY_INFORMATION

The type of security information to retrieve.

sidOwner [out, optional]

Type: PSID*

The owner security identifier (SID) in the returned security descriptor.

sidGroup [out, optional]

Type: PSID*

The primary group security identifier (SID) in the returned security descriptor.

dacl [out, optional]

Type: PACL*

The discretionary access control list (DACL) in the returned security descriptor.

sacl [out, optional]

Type: PACL*

The system access control list (SACL) in the returned security descriptor.

securityDescriptor [out]

Type: PSECURITY_DESCRIPTOR*

The returned security descriptor.

Return value

Type: DWORD

Return code/valueDescription
ERROR_SUCCESS
0

The security descriptor was retrieved successfully.

FWP_E_* error code
0x80320001—0x80320039

A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details.

RPC_* error code
0x80010001—0x80010122

Failure to communicate with the remote or local firewall engine.

 

Remarks

The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned parameters must not be freed, as they point to addresses within the securityDescriptor parameter.

This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described in the GetSecurityInfo reference topic.

FwpmEngineGetSecurityInfo0 is a specific implementation of FwpmEngineGetSecurityInfo. See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information.

Examples

The following C++ example illustrates initialization of a security descriptor object using FwpmEngineGetSecurityInfo0.


#include <windows.h>
#include <fwpmu.h>
#include <stdio.h>

#pragma comment(lib, "Fwpuclnt.lib")

void main()
{
    HANDLE engineHandle = NULL;
    DWORD  result = ERROR_SUCCESS;

    PSECURITY_DESCRIPTOR securityDescriptor;
    SECURITY_INFORMATION securityInfo = OWNER_SECURITY_INFORMATION;

    // Several functions that use the SECURITY_DESCRIPTOR structure require that this 
    // structure be aligned on a valid pointer boundary in memory. These boundaries 
    // vary depending on the type of processor used. 

    securityDescriptor = (PSECURITY_DESCRIPTOR) malloc(sizeof(SECURITY_DESCRIPTOR));

    result = FwpmEngineOpen0( NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &engineHandle );
    if (result != ERROR_SUCCESS)
    {
        printf("FwpmEngineOpen0 failed.\n");
        return;
    }
    
    result = FwpmEngineGetSecurityInfo0(
                 engineHandle, 
                 securityInfo,
                 NULL,
                 NULL,
                 NULL,
                 NULL,
                 &securityDescriptor);

    if (result != ERROR_SUCCESS)
    {
        printf("FwpmEngineGetSecurityInfo0 failed.\n");
        return;
    }

    return;
}


Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Fwpmu.h

Library

Fwpuclnt.lib

DLL

Fwpuclnt.dll

See also

FwpmEngineSetSecurityInfo0

 

 

Community Additions

ADD
Show:
© 2015 Microsoft