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