LPDHCP_HANDLE_OPTIONS callback function (dhcpssdk.h)

The DhcpHandleOptionsHook function enables third-party DLLs to obtain commonly used options from a DHCP packet, avoiding the need to process the entire DHCP packet. The DhcpHandleOptionsHook function should not block.

Syntax

LPDHCP_HANDLE_OPTIONS LpdhcpHandleOptions;

DWORD LpdhcpHandleOptions(
  [in]      LPBYTE Packet,
  [in]      DWORD PacketSize,
  [in]      LPVOID Reserved,
  [in]      LPVOID PktContext,
  [in, out] LPDHCP_SERVER_OPTIONS ServerOptions
)
{...}

Parameters

[in] Packet

Buffer for the packet being processed.

[in] PacketSize

Size of the Packet parameter, in bytes.

[in] Reserved

Reserve for future use.

[in] PktContext

Context identifying the packet, as provided in the PktContext parameter of a previous DhcpNewPktHook function call.

[in, out] ServerOptions

Structure of type DHCP_SERVER_OPTIONS containing the information parsed from the packet by Microsoft DHCP Server, and provided as the collection of commonly used server options.

Return value

Return values are defined by the application providing the callback.

Remarks

The DhcpHandleOptionsHook function is useful when developers of third-party DLLs want to avoid having to process an entire DHCP packet, and rather, could achieve the desired results by a set of commonly used server options. When third-party DLLs register for this event notification, the Microsoft DHCP Server parses the incoming packet, extracts commonly used server options, and passes them to the third-party DLL in the ServerOptions parameter.

If the DHCP_SERVER_OPTIONS structure pointed to in ServerOptions is needed beyond the completion of the DhcpHandleOptionsHook function call, third-party DLLs must make a copy of the structure.

The DhcpHandleOptionsHook function can be called multiple times for a single packet.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header dhcpssdk.h

See also

DHCP_CALLOUT_TABLE

DHCP_SERVER_OPTIONS

DhcpNewPktHook