Fixed compile warnings under windows
[oweals/gnunet.git] / src / util / win.cc
index 8e71744d0492382affe5cb975790d6eefd4ef22d..2cc3b8f716ca272a5fb843b80e812f66ebe0b627 100644 (file)
 */\r
 \r
 /**\r
- * @file util/win/win.cc\r
+ * @file util/win.cc\r
  * @brief Helper functions for MS Windows in C++\r
  * @author Nils Durner\r
- **/\r
+ */\r
 \r
 #ifndef _WIN_CC\r
 #define _WIN_CC\r
@@ -42,21 +42,8 @@ using namespace std;
 \r
 extern "C" {\r
 \r
-typedef list<WSAOVERLAPPED *> TOLList;\r
-\r
-static HANDLE hOLLock;\r
-static TOLList lstOL;\r
-\r
 int plibc_conv_to_win_path(const char *pszUnix, char *pszWindows);\r
 \r
-void __attribute__ ((constructor)) gnunet_win_init() {\r
-  hOLLock = CreateMutex(NULL, FALSE, NULL);\r
-}\r
-\r
-void __attribute__ ((destructor)) gnunet_win_fini() {\r
-  CloseHandle(hOLLock);\r
-}\r
-\r
 /**\r
  * Enumerate all network adapters\r
  */\r
@@ -103,9 +90,11 @@ void EnumNICs(PMIB_IFTABLE *pIfTable, PMIB_IPADDRTABLE *pAddrTable)
 /**\r
  * Lists all network interfaces in a combo box\r
  * Used by the basic GTK configurator\r
- * @param callback\r
+ *\r
+ * @param callback function to call for each NIC\r
+ * @param callback_cls closure for callback\r
  */\r
-  int ListNICs(void (*callback) (const char *, int, void *), void * cls)\r
+  int ListNICs(void (*callback) (void *, const char *, int), void * callback_cls)\r
 {\r
   PMIB_IFTABLE pTable;\r
   PMIB_IPADDRTABLE pAddrTable;\r
@@ -201,7 +190,9 @@ void EnumNICs(PMIB_IFTABLE *pIfTable, PMIB_IPADDRTABLE *pAddrTable)
         if (pszIfName)\r
                free(pszIfName);\r
 \r
-        callback(szEntry, pAddrTable->table[dwIfIdx].dwIndex == dwExternalNIC, cls);\r
+        callback(callback_cls,\r
+                szEntry, \r
+                pAddrTable->table[dwIfIdx].dwIndex == dwExternalNIC);\r
       }\r
     }\r
     GlobalFree(pAddrTable);\r
@@ -513,7 +504,7 @@ int CreateServiceAccount(char *pszName, char *pszDesc)
  * @brief Grant permission to a file\r
  * @param lpszFileName the name of the file or directory\r
  * @param lpszAccountName the user account\r
- * @param the desired access (e.g. GENERIC_ALL)\r
+ * @param dwAccessMask the desired access (e.g. GENERIC_ALL)\r
  * @return TRUE on success\r
  * @remark based on http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q102102&\r
  */\r