14#define COMM_PIPE_OUTPUT_BUFFER sizeof(COMM_DHCP_REQ)
15#define COMM_PIPE_INPUT_BUFFER sizeof(COMM_DHCP_REPLY)
16#define COMM_PIPE_DEFAULT_TIMEOUT 1000
71 &AuthenticatedUsersSid))
73 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to create Authenticated Users SID (error code %d)\n",
GetLastError());
84 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to create Network Ops SID (error code %d)\n",
GetLastError());
96 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to create Admins SID (error code %d)\n",
GetLastError());
107 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to create Local System SID (error code %d)\n",
GetLastError());
115 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to allocate absolute security descriptor!\n");
122 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to initialize absolute security descriptor (error code %d)\n",
GetLastError());
136 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to allocate DACL!\n");
143 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to initialize DACL (error code %d)\n",
GetLastError());
151 AuthenticatedUsersSid))
153 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up ACE for Authenticated Users SID (error code %d)\n",
GetLastError());
163 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up ACE for Network Ops SID (error code %d)\n",
GetLastError());
173 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up ACE for Admins SID (error code %d)\n",
GetLastError());
183 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up ACE for Local System SID (error code %d)\n",
GetLastError());
190 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up DACL to absolute security descriptor (error code %d)\n",
GetLastError());
197 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up owner to absolute security descriptor (error code %d)\n",
GetLastError());
204 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to set up group to absolute security descriptor (error code %d)\n",
GetLastError());
211 DPRINT1(
"CreateDhcpPipeSecurity(): Unexpected error code (error code %d -- must be ERROR_INSUFFICIENT_BUFFER)\n",
GetLastError());
219 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to allocate relative SD!\n");
226 DPRINT1(
"CreateDhcpPipeSecurity(): Failed to allocate relative SD, buffer too smal (expected size %lu)\n", RelSDSize);
243 if (AuthenticatedUsersSid)
245 FreeSid(AuthenticatedUsersSid);
293 DbgPrint(
"DHCP: Could not create security descriptor for pipe\n");
309 &SecurityAttributes );
313 DbgPrint(
"DHCP: Could not create named pipe\n");
329 DPRINT(
"WaitForMultipleObjects() returned %lu\n", dwError);
348 DbgPrint(
"DHCP: Could not connect named pipe\n");
361 DPRINT(
"WaitForMultipleObjects() returned %lu\n", dwError);
407 DPRINT1(
"Unrecognized request type %d\n", Req.
Type);
417 DPRINT(
"Pipe thread stopped!\n");
DWORD DSQueryHWInfo(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
DWORD DSStaticRefreshParams(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
DWORD DSRenewIpAddressLease(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
DWORD DSReleaseIpAddressLease(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
DWORD DSGetAdapterInfo(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
DWORD DSLeaseIpAddress(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
#define COMM_PIPE_DEFAULT_TIMEOUT
DWORD CreateDhcpPipeSecurity(PSECURITY_DESCRIPTOR *SecurityDescriptor)
Creates a security descriptor for the DHCP pipe service.
DWORD WINAPI PipeThreadProc(LPVOID Parameter)
#define COMM_PIPE_OUTPUT_BUFFER
HANDLE PipeInit(HANDLE hStopEvent)
#define COMM_PIPE_INPUT_BUFFER
DWORD PipeSend(HANDLE CommPipe, COMM_DHCP_REPLY *Reply)
static SID_IDENTIFIER_AUTHORITY NtAuthority
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI CancelIo(IN HANDLE hFile)
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI AddAccessAllowedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
DWORD WINAPI GetLengthSid(PSID pSid)
PVOID WINAPI FreeSid(PSID pSid)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
#define FILE_FLAG_OVERLAPPED
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe)
HANDLE WINAPI CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define FILE_FLAG_FIRST_PIPE_INSTANCE
@ DhcpReqStaticRefreshParams
@ DhcpReqReleaseIpAddress
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, LPDWORD lpdwBufferLength)
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
LPVOID lpSecurityDescriptor
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
DWORD WINAPI GetLastError(void)
#define PIPE_ACCESS_DUPLEX
#define PIPE_READMODE_MESSAGE
#define PIPE_TYPE_MESSAGE
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Inout_opt_ PVOID Parameter
#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_LOCAL_SYSTEM_RID
#define SECURITY_AUTHENTICATED_USER_RID
#define SECURITY_NT_AUTHORITY
#define SECURITY_DESCRIPTOR_REVISION
#define DOMAIN_ALIAS_RID_ADMINS