A internal table is maintain by Microsoft DHCP Server on the occurence of dhcp protocol, trigger third-party DLL function calls. Developers register to have occurrence of these events call their functions by creating a specified registry entry that Microsoft DHCP Server reads upon startup.
The location of the registry entry is:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCPServer\Parameters
The following registry key values must be specified for this entry in order to enable the callout server:
Key Name | Key Datatype | Value |
---|---|---|
CalloutDlls | REG_MULTI_SZ | String that contains the local path to the DHCP callout DLL. For example: "C:\Program Files\MyCalloutServer\my_dhcp.dll" |
CalloutEnabled | DWORD | 32-bit unsigned integer value that specifies 0 if the DHCP callout server is not enabled, and 1 if it is. |
How Microsoft DHCP Server loads and handles third-party DLLs impacts third-party DLL developers. Microsoft DHCP Server takes the following steps in loading third-party DLLs:
- Microsoft DHCP Server checks the previously defined registry location for the presence of third-party DLLs.
- If no registry entries are found, the DHCP Server internal hook table remains empty, and no DHCP Server event notifications are sent.
- If one or more registry entries is found, Microsoft DHCP Server reads the first registry entry, in alphabetical order, and attempts to load the corresponding third-party DLL. If the DLL loads successfully, Microsoft DHCP Server ceases checking for additional third-party DLLs.
- Microsoft DHCP Server calls the DhcpServerCalloutEntry function in the loaded third-party DLL, retrieving the associated DHCP_CALLOUT_TABLE function and thereby determining which events initiate notification to the third-party DLL. Notification comes in the form of corresponding third-party functions: one or more of which can be included in the third-party DLL, and each of which are defined in the following DHCP Server API reference pages.
Source: msdn.microsoft.com
No comments:
Post a Comment