[1166] | 1 | /**
|
---|
| 2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
| 3 | * This file is part of the mingw-w64 runtime package.
|
---|
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
| 5 | */
|
---|
| 6 | #ifndef _INC_WDSPXE
|
---|
| 7 | #define _INC_WDSPXE
|
---|
| 8 | #if (_WIN32_WINNT >= 0x0600)
|
---|
| 9 |
|
---|
| 10 | #ifdef __cplusplus
|
---|
| 11 | extern "C" {
|
---|
| 12 | #endif
|
---|
| 13 |
|
---|
| 14 | #define PXE_ADDR_BROADCAST 0x0001
|
---|
| 15 | #define PXE_ADDR_USE_PORT 0x0002
|
---|
| 16 | #define PXE_ADDR_USE_ADDR 0x0004
|
---|
| 17 | #define PXE_ADDR_USE_DHCP_RULES 0x0008
|
---|
| 18 |
|
---|
| 19 | #ifndef PXEAPI
|
---|
| 20 | #define PXEAPI WINAPI
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 | typedef ULONG PXE_BOOT_ACTION;
|
---|
| 24 | typedef ULONG PXE_REG_INDEX;
|
---|
| 25 | typedef ULONG PXE_PROVIDER_ATTRIBUTE;
|
---|
| 26 |
|
---|
| 27 | typedef struct tagPXE_ADDRESS {
|
---|
| 28 | ULONG uFlags;
|
---|
| 29 | __C89_NAMELESS union {
|
---|
| 30 | BYTE bAddress[PXE_MAX_ADDRESS];
|
---|
| 31 | ULONG uIpAddress;
|
---|
| 32 | } DUMMYUNIONNAME;
|
---|
| 33 | ULONG uAddrLen;
|
---|
| 34 | USHORT uPort;
|
---|
| 35 | } PXE_ADDRESS, *PPXE_ADDRESS;
|
---|
| 36 |
|
---|
| 37 | typedef struct _PXE_DHCP_MESSAGE {
|
---|
| 38 | BYTE Operation;
|
---|
| 39 | BYTE HardwareAddressType;
|
---|
| 40 | BYTE HardwareAddressLength;
|
---|
| 41 | BYTE HopCount;
|
---|
| 42 | DWORD TransactionID;
|
---|
| 43 | WORD SecondsSinceBoot;
|
---|
| 44 | WORD Reserved;
|
---|
| 45 | ULONG ClientIpAddress;
|
---|
| 46 | ULONG YourIPAddress;
|
---|
| 47 | ULONG BootstrapServerAddress;
|
---|
| 48 | ULONG RelayAgentIpAddress;
|
---|
| 49 | BYTE HardwareAddress[PXE_DHCP_HWAADR_SIZE];
|
---|
| 50 | BYTE HostName[PXE_DHCP_SERVER_SIZE];
|
---|
| 51 | BYTE BootFileName;
|
---|
| 52 | __C89_NAMELESS union {
|
---|
| 53 | BYTE bMagicCookie[PXE_DHCP_MAGIC_COOKIE_SIZE];
|
---|
| 54 | ULONG uMagicCookie;
|
---|
| 55 | } DUMMYUNIONNAME;
|
---|
| 56 | } PXE_DHCP_MESSAGE, *PPXE_DHCP_MESSAGE;
|
---|
| 57 |
|
---|
| 58 | typedef struct _PXE_DHCP_OPTION {
|
---|
| 59 | BYTE OptionType;
|
---|
| 60 | BYTE OptionLength;
|
---|
| 61 | BYTE OptionValue[1];
|
---|
| 62 | } PXE_DHCP_OPTION, *PPXE_DHCP_OPTION;
|
---|
| 63 |
|
---|
| 64 | #define PXE_BA_NBP 1
|
---|
| 65 | #define PXE_BA_CUSTOM 2
|
---|
| 66 | #define PXE_BA_IGNORE 3
|
---|
| 67 | #define PXE_BA_REJECTED 4
|
---|
| 68 |
|
---|
| 69 | typedef struct tagPXE_PROVIDER {
|
---|
| 70 | ULONG uSizeOfStruct;
|
---|
| 71 | LPWSTR pwszName;
|
---|
| 72 | LPWSTR pwszFilePath;
|
---|
| 73 | WINBOOL bIsCritical;
|
---|
| 74 | ULONG uIndex;
|
---|
| 75 | } PXE_PROVIDER, *PPXE_PROVIDER;
|
---|
| 76 |
|
---|
| 77 | DWORD PXEAPI PxeDhcpAppendOption(PVOID pReplyPacket,ULONG uMaxReplyPacketLen,PULONG puReplyPacketLen,BYTE bOption,BYTE bOptionLen,PVOID pValue);
|
---|
| 78 | DWORD PXEAPI PxeDhcpGetOptionValue(PVOID pPacket,ULONG uPacketLen,ULONG uInstance,BYTE bOption,PBYTE pbOptionLen,PVOID *ppOptionValue);
|
---|
| 79 | DWORD PXEAPI PxeDhcpGetVendorOptionValue(PVOID pPacket,ULONG uPacketLen,BYTE bOption,ULONG uInstance,PBYTE pbOptionLen,PVOID *ppOptionValue);
|
---|
| 80 | DWORD PXEAPI PxeDhcpInitialize(PVOID pRecvPacket,ULONG uRecvPacketLen,PVOID pReplyPacket,ULONG uMaxReplyPacketLen,PULONG puReplyPacketLen);
|
---|
| 81 | DWORD PXEAPI PxeDhcpIsValid(PVOID pPacket,ULONG uPacketLen,WINBOOL bRequestPacket,PBOOL pbPxeOptionPresent);
|
---|
| 82 |
|
---|
| 83 | typedef enum _PXE_GSI_TYPE {
|
---|
| 84 | PXE_GSI_TRACE_ENABLED = 1
|
---|
| 85 | } PXE_GSI_TYPE;
|
---|
| 86 |
|
---|
| 87 | DWORD PXEAPI PxeGetServerInfo(PXE_GSI_TYPE uInfoType,PVOID pBuffer,ULONG uBufferLen);
|
---|
| 88 | PVOID PXEAPI PxePacketAllocate(HANDLE hProvider,HANDLE hClientRequest,ULONG uSize);
|
---|
| 89 | DWORD PXEAPI PxePacketFree(HANDLE hProvider,HANDLE hClientRequest,PVOID pPacket);
|
---|
| 90 | DWORD PXEAPI PxeProviderEnumClose(HANDLE hEnum);
|
---|
| 91 | DWORD PXEAPI PxeProviderEnumFirst(HANDLE *phEnum);
|
---|
| 92 | DWORD PXEAPI PxeProviderEnumNext(HANDLE hEnum,PPXE_PROVIDER *ppProvider);
|
---|
| 93 | DWORD PXEAPI PxeProviderFreeInfo(PPXE_PROVIDER pProvider);
|
---|
| 94 | DWORD PXEAPI PxeProviderInitialize(HANDLE hProvider,HKEY hProviderKey);
|
---|
| 95 | DWORD PXEAPI PxeProviderQueryIndex(LPCWSTR pszProviderName,PULONG puIndex);
|
---|
| 96 | DWORD PXEAPI PxeProviderRecvRequest(HANDLE hClientRequest,PVOID pPacket,ULONG uPacketLen,PXE_ADDRESS *pLocalAddress,PXE_ADDRESS *pRemoteAddress,PXE_BOOT_ACTION pAction,PVOID pContext);
|
---|
| 97 |
|
---|
| 98 | #define PXE_REG_INDEX_TOP __MSABI_LONG(0U)
|
---|
| 99 | #define PXE_REG_INDEX_BOTTOM __MSABI_LONG(0xFFFFFFFFU)
|
---|
| 100 |
|
---|
| 101 | DWORD PXEAPI PxeProviderRegister(LPCWSTR pszProviderName,LPCWSTR pszModulePath,PXE_REG_INDEX Index,WINBOOL bIsCritical,PHKEY phProviderKey);
|
---|
| 102 | DWORD PXEAPI PxeProviderServiceControl(PVOID pContext,DWORD dwControl);
|
---|
| 103 | DWORD PXEAPI PxeProviderSetAttribute(HANDLE hProvider,PXE_PROVIDER_ATTRIBUTE Attribute,PVOID pParameterBuffer,ULONG uParamLen);
|
---|
| 104 |
|
---|
| 105 | #define PXE_PROV_ATTR_FILTER 0
|
---|
| 106 |
|
---|
| 107 | #define PXE_PROV_FILTER_ALL 0x0000
|
---|
| 108 | #define PXE_PROV_FILTER_DHCP_ONLY 0x0001
|
---|
| 109 | #define PXE_PROV_FILTER_PXE_ONLY 0x0002
|
---|
| 110 |
|
---|
| 111 | DWORD PXEAPI PxeProviderSetAttribute(HANDLE hProvider,PXE_PROVIDER_ATTRIBUTE Attribute,PVOID pParameterBuffer,ULONG uParamLen);
|
---|
| 112 | DWORD PXEAPI PxeProviderShutdown(PVOID pContext);
|
---|
| 113 | DWORD PXEAPI PxeProviderUnRegister(LPCWSTR pszProviderName);
|
---|
| 114 |
|
---|
| 115 | typedef enum _PXE_CALLBACK_TYPE {
|
---|
| 116 | PXE_CALLBACK_RECV_REQUEST = 0,
|
---|
| 117 | PXE_CALLBACK_SHUTDOWN,
|
---|
| 118 | PXE_CALLBACK_SERVICE_CONTROL,
|
---|
| 119 | PXE_CALLBACK_MAX
|
---|
| 120 | } PXE_CALLBACK_TYPE;
|
---|
| 121 |
|
---|
| 122 | DWORD PXEAPI PxeSendReply(HANDLE hClientRequest,PVOID pPacket,ULONG uPacketLen,PXE_ADDRESS *pAddress);
|
---|
| 123 | DWORD PXEAPI PxeRegisterCallback(HANDLE hProvider,PXE_CALLBACK_TYPE CallbackType,PVOID pCallbackFunction,PVOID pContext);
|
---|
| 124 |
|
---|
| 125 | typedef DWORD PXE_SEVERITY;
|
---|
| 126 |
|
---|
| 127 | #define PXE_TRACE_VERBOSE 0x00010000
|
---|
| 128 | #define PXE_TRACE_INFO 0x00020000
|
---|
| 129 | #define PXE_TRACE_WARNING 0x00040000
|
---|
| 130 | #define PXE_TRACE_ERROR 0x00080000
|
---|
| 131 | #define PXE_TRACE_FATAL 0x00100000
|
---|
| 132 |
|
---|
| 133 | DWORD WINAPIV PxeTrace(HANDLE hProvider,PXE_SEVERITY Severity,LPCWSTR pszFormat,...);
|
---|
| 134 |
|
---|
| 135 | #ifdef __cplusplus
|
---|
| 136 | }
|
---|
| 137 | #endif
|
---|
| 138 | #endif /*(_WIN32_WINNT >= 0x0600)*/
|
---|
| 139 | #endif /*_INC_WDSPXE*/
|
---|