Share via


FirewallGetRules

This function obtains information about firewall rules. The function stores the information in memory that is provided by the caller and pointed to by the pRules argument.

DWORD FirewallGetRules(
  PFW RULE pRules, 
  DWORD* pdwSize, 
  DWORD* pdwCount
);

Parameters

  • pRules
    [in] Pointer to the array of FW_RULE structures that describe firewall rules. This parameter is optional and may be set to NULL.
  • pdwSize
    [in, out] On input, a pointer to a DWORD that indicates the size of the memory block pointed to by pRules. On output, the number of bytes written to the buffer or, if the supplied memory buffer was too small, the required buffer size, in bytes.
  • pdwCount
    [out] Pointer to a DWORD that indicates the number of rules that were returned. This parameter is optional and may be set to NULL.

Return Values

This function returns ERROR_SUCCESS when operation succeeds. If the provided memory buffer is too small, it returns ERROR_INSUFFICIENT_BUFFER.

Remarks

You can obtain the required size of memory to be passed to this function by calling this function with pRules set to NULL and pdwSize points to a DWORD variable that is set to zero (0). The function will fail, returning the value ERROR_INSUFFICIENT_BUFFER. The variable pointed to by pdwSize will contain the required memory size, in bytes.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Fwapi.h.
Link Library: Fwapi.lib.

See Also

Firewall Functions | System Errors - Alphabetical Order

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.