다음을 통해 공유


FirewallGetRules (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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 can be set to NULL.
  • pdwSize
    [in, out] On input, a pointer to a DWORD that indicates the size of the memory block indicated by pRules. On output, this parameter contains the number of bytes written to the buffer or, if the supplied memory buffer is too small, the required buffer size, in bytes.
  • pdwCount
    [out] Pointer to a value that indicates the number of rules that have been retrieved. This parameter is optional and can be set to NULL.

Return Value

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 set to zero (0). The function will fail, returning the value ERROR_INSUFFICIENT_BUFFER. The parameter pdwSize will contain the required memory size, in bytes.

Requirements

Header fwapi.h
Library fwapi.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

IP Firewall Functions

Other Resources

System Errors - Alphabetical Order