@@ -102,47 +102,49 @@ my_bool my_gethwaddr(uchar *to)
102102}
103103
104104#elif defined(__WIN__ )
105-
106- /* Workaround for BUG#32082 (Definition of VOID in my_global.h conflicts with
107- windows headers) */
108- #ifdef VOID
109- #undef VOID
110- #define VOID void
111- #endif
105+
106+ /*
107+ Workaround for BUG#32082 (Definition of VOID in my_global.h conflicts with
108+ windows headers)
109+ */
110+ #ifdef VOID
111+ #undef VOID
112+ #define VOID void
113+ #endif
112114
113115#include <iphlpapi.h>
114116
115- /*
116- The following typedef is for dynamically loading
117- iphlpapi.dll / GetAdaptersAddresses. Dynamic loading is
118- used because GetAdaptersAddresses is not available on Windows 2000
119- which MySQL still supports. Static linking would cause an unresolved export.
117+ /*
118+ The following typedef is for dynamically loading iphlpapi.dll /
119+ GetAdaptersAddresses. Dynamic loading is used because
120+ GetAdaptersAddresses is not available on Windows 2000 which MySQL
121+ still supports. Static linking would cause an unresolved export.
120122*/
121123typedef DWORD (WINAPI * pfnGetAdaptersAddresses )(IN ULONG Family ,
122124 IN DWORD Flags ,IN PVOID Reserved ,
123- OUT PIP_ADAPTER_ADDRESSES pAdapterAddresses ,
125+ OUT PIP_ADAPTER_ADDRESSES pAdapterAddresses ,
124126 IN OUT PULONG pOutBufLen );
125127
126128/*
127- my_gethwaddr - Windows version
129+ my_gethwaddr - Windows version
128130
129131 @brief Retrieve MAC address from network hardware
130-
132+
131133 @param[out] to MAC address exactly six bytes
132-
134+
133135 @return Operation status
134136 @retval 0 OK
135- @retval <>0 FAILED
137+ @retval <>0 FAILED
136138*/
137139my_bool my_gethwaddr (uchar * to )
138- {
140+ {
139141 PIP_ADAPTER_ADDRESSES pAdapterAddresses ;
140142 PIP_ADAPTER_ADDRESSES pCurrAddresses ;
141143 IP_ADAPTER_ADDRESSES adapterAddresses ;
142144 ULONG address_len ;
143- my_bool return_val = 1 ;
144- static pfnGetAdaptersAddresses fnGetAdaptersAddresses =
145- (pfnGetAdaptersAddresses )- 1 ;
145+ my_bool return_val = 1 ;
146+ static pfnGetAdaptersAddresses fnGetAdaptersAddresses =
147+ (pfnGetAdaptersAddresses )- 1 ;
146148
147149 if (fnGetAdaptersAddresses == (pfnGetAdaptersAddresses )- 1 )
148150 {
@@ -156,7 +158,7 @@ my_bool my_gethwaddr(uchar *to)
156158 address_len = sizeof (IP_ADAPTER_ADDRESSES );
157159
158160 /* Get the required size for the address data. */
159- if (fnGetAdaptersAddresses (AF_UNSPEC , 0 , 0 , & adapterAddresses , & address_len )
161+ if (fnGetAdaptersAddresses (AF_UNSPEC , 0 , 0 , & adapterAddresses , & address_len )
160162 == ERROR_BUFFER_OVERFLOW )
161163 {
162164 pAdapterAddresses = my_malloc (address_len , 0 );
@@ -167,29 +169,29 @@ my_bool my_gethwaddr(uchar *to)
167169 pAdapterAddresses = & adapterAddresses ; /* one is enough don't alloc */
168170
169171 /* Get the hardware info. */
170- if (fnGetAdaptersAddresses (AF_UNSPEC , 0 , 0 , pAdapterAddresses , & address_len )
172+ if (fnGetAdaptersAddresses (AF_UNSPEC , 0 , 0 , pAdapterAddresses , & address_len )
171173 == NO_ERROR )
172174 {
173175 pCurrAddresses = pAdapterAddresses ;
174176
175- while (pCurrAddresses )
177+ while (pCurrAddresses )
176178 {
177179 /* Look for ethernet cards. */
178180 if (pCurrAddresses -> IfType == IF_TYPE_ETHERNET_CSMACD )
179181 {
180182 /* check for a good address */
181183 if (pCurrAddresses -> PhysicalAddressLength < 6 )
182- continue ; /* bad address */
184+ continue ; /* bad address */
183185
184186 /* save 6 bytes of the address in the 'to' parameter */
185187 memcpy (to , pCurrAddresses -> PhysicalAddress , 6 );
186188
187189 /* Network card found, we're done. */
188190 return_val = 0 ;
189- break ;
191+ break ;
190192 }
191193 pCurrAddresses = pCurrAddresses -> Next ;
192- }
194+ }
193195 }
194196
195197 /* Clean up memory allocation. */
0 commit comments