18 DWORD MaxSubKeyLen = 0, MaxSubKeys = 0;
27 &MaxSubKeys, &MaxSubKeyLen,
32 MaxSubKeys, MaxSubKeyLen));
34 CharTotal = (
sizeof(
PCHAR) + MaxSubKeyLen + AppendLen) * (MaxSubKeys + 1);
37 AppendLen, CharTotal));
40 OutKeyName = ((
PCHAR)&
Out[MaxSubKeys+1]);
49 strcat( OutKeyName, Append );
51 OutKeyName +=
strlen(OutKeyName) + 1;
68 if( Subkey &&
strlen(Subkey) ) {
71 }
else ValueKey =
Root;
93 if( SubOut ) {
free( SubOut ); SubOut =
NULL; }
95 if( ValueKey && ValueKey !=
Root ) {
108 "SYSTEM\\CurrentControlSet\\Control\\Class\\"
109 "{4D36E972-E325-11CE-BFC1-08002BE10318}";
110 PCHAR TargetKeyNameStart =
111 "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
119 if( !EnumKeysLinkage || !EnumKeysTop )
goto cleanup;
125 for(
i = 0; EnumKeysLinkage[
i];
i++ ) {
127 (
EnumKey, EnumKeysLinkage[
i],
"RootDevice" );
133 strlen( RootDevice ) + 1);
134 if( !TargetKeyName )
goto cleanup;
135 sprintf( TargetKeyName,
"%s%s",
136 TargetKeyNameStart, RootDevice );
140 free( RootDevice ); RootDevice = 0;
145 if( RootDevice )
free( RootDevice );
146 if( EnumKeysLinkage )
free( EnumKeysLinkage );
147 if( EnumKeysTop )
free( EnumKeysTop );
148 if( TargetKeyName )
free( TargetKeyName );
215 char *ZeroAddress =
"0.0.0.0";
254 for (; AdapterInfo !=
NULL; AdapterInfo = AdapterInfo->
Next)
260 if (AdapterInfo ==
NULL)
298 int i, AdapterCount = 0, Broadcast;
320 for(
i =
Table->dwNumEntries - 1;
i >= 0;
i-- ) {
322 Table->table[
i].dwIndex));
376 sizeof(Adapter->
IfMib) );
406 (
const char *)&Broadcast,
453 }
else {
free( Adapter ); Adapter = 0; }
454 }
else {
free( Adapter ); Adapter = 0; }
458 Table->table[
i].dwIndex));
467 DPRINT(
"Stopping the discovery thread!\n");
476 DPRINT(
"Adapter discovery thread terminated! (Error: %d)\n",
Error);
504 ListEntry = ListEntry->
Flink ) {
518 ListEntry = ListEntry->
Flink ) {
532 ListEntry = ListEntry->
Flink ) {
546 ListEntry = ListEntry->
Flink) {
551 hlen))
return Adapter;
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
void if_register_receive(struct interface_info *ip)
PCHAR * GetSubkeyNames(PCHAR MainKeyName, PCHAR Append)
HANDLE hAdapterStateChangedEvent
HANDLE StartAdapterDiscovery(HANDLE hStopEvent)
int InterfaceConnected(const MIB_IFROW *IfEntry)
PDHCP_ADAPTER AdapterGetFirst()
DWORD WINAPI AdapterDiscoveryThread(LPVOID Context)
PDHCP_ADAPTER AdapterFindIndex(unsigned int indx)
PDHCP_ADAPTER AdapterFindByHardwareAddress(u_int8_t haddr[16], u_int8_t hlen)
BOOL PrepareAdapterForService(PDHCP_ADAPTER Adapter)
PCHAR RegReadString(HKEY Root, PCHAR Subkey, PCHAR Value)
PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER This)
static LIST_ENTRY AdapterList
PDHCP_ADAPTER AdapterFindName(const WCHAR *name)
BOOL IsReconnectHackNeeded(PDHCP_ADAPTER Adapter, const MIB_IFROW *IfEntry)
void if_register_send(struct interface_info *ip)
HKEY FindAdapterKey(PDHCP_ADAPTER Adapter)
PDHCP_ADAPTER AdapterFindInfo(struct interface_info *ip)
void add_protocol(char *name, int fd, void(*handler)(struct protocol *), void *local)
void remove_protocol(struct protocol *proto)
void got_one(struct protocol *l)
struct protocol * find_protocol_by_adapter(struct interface_info *info)
int read_client_conf(struct interface_info *ifi)
#define DH_DbgPrint(_t_, _x_)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
void state_init(void *ipp)
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
#define HeapFree(x, y, z)
static void cleanup(void)
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)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct _MIB_IFTABLE * PMIB_IFTABLE
struct _MIB_IFTABLE MIB_IFTABLE
DWORD WINAPI NotifyAddrChange(PHANDLE Handle, LPOVERLAPPED overlapped)
DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
#define MIB_IF_TYPE_ETHERNET
@ IF_OPER_STATUS_CONNECTED
@ IF_OPER_STATUS_OPERATIONAL
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
static LONG WINAPI EnumKey(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName, PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define DHCP_REBOOT_TIMEOUT
#define DHCP_PANIC_TIMEOUT
#define DHCP_DISCOVER_INTERVAL
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
root entry for file system trees
MIB_IPFORWARDROW RouterMib
unsigned char recv_buf[1]
struct interface_info DhclientInfo
struct client_state DhclientState
struct client_config DhclientConfig
struct sockaddr_in ListenAddr
IP_ADDR_STRING IpAddressList
struct _IP_ADAPTER_INFO * Next
IP_ADDRESS_STRING IpAddress
struct _LIST_ENTRY * Flink
UCHAR bPhysAddr[MAXLEN_PHYSADDR]
BYTE bDescr[MAXLEN_IFDESCR]
WCHAR wszName[MAX_INTERFACE_NAME_LEN]
INTERNAL_IF_OPER_STATUS dwOperStatus
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
struct _LIST_ENTRY * PLIST_ENTRY
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define ERROR_BUFFER_OVERFLOW
#define HKEY_LOCAL_MACHINE
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)