aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-23 19:40:33 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-23 19:40:33 +0000
commit65d57acfd43652bc6d410cac59e06e2de46c26e6 (patch)
treeff8746154069da627a748bf6b245a04ab6422062 /src/util
parent5ff4dfc1a9e98f599ddc10b15ecae0b42fe5ec4c (diff)
downloadgnunet-65d57acfd43652bc6d410cac59e06e2de46c26e6.tar.gz
gnunet-65d57acfd43652bc6d410cac59e06e2de46c26e6.zip
-more cosmetics to reduce compiler warnings
Diffstat (limited to 'src/util')
-rw-r--r--src/util/win.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/src/util/win.c b/src/util/win.c
index 041c00e2f..fe06f1265 100644
--- a/src/util/win.c
+++ b/src/util/win.c
@@ -300,18 +300,19 @@ int
300EnumNICs2 (INTERFACE_INFO **ifs4, int *ifs4_len, SOCKET_ADDRESS_LIST **ifs6) 300EnumNICs2 (INTERFACE_INFO **ifs4, int *ifs4_len, SOCKET_ADDRESS_LIST **ifs6)
301{ 301{
302 int result = 0; 302 int result = 0;
303 SOCKET s4 = INVALID_SOCKET, s6 = INVALID_SOCKET; 303 SOCKET s4;
304 DWORD dwret1 = 0, dwret2; 304 SOCKET s6;
305 DWORD err1, err2; 305 int ifs4len = 0;
306 int ifs4len = 0, ifs6len = 0; 306 int ifs6len = 0;
307 INTERFACE_INFO *interfaces4 = NULL; 307 INTERFACE_INFO *interfaces4 = NULL;
308 SOCKET_ADDRESS_LIST *interfaces6 = NULL; 308 SOCKET_ADDRESS_LIST *interfaces6 = NULL;
309
309 SetLastError (0); 310 SetLastError (0);
310 s4 = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); 311 s4 = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
311 err1 = GetLastError (); 312 (void) GetLastError ();
312 SetLastError (0); 313 SetLastError (0);
313 s6 = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP); 314 s6 = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
314 err2 = GetLastError (); 315 (void) GetLastError ();
315 if (s6 != INVALID_SOCKET) 316 if (s6 != INVALID_SOCKET)
316 { 317 {
317 ifs6len = EnumNICs_IPv6_get_ifs_count (s6); 318 ifs6len = EnumNICs_IPv6_get_ifs_count (s6);
@@ -352,8 +353,9 @@ error:
352 return GNUNET_SYSERR; 353 return GNUNET_SYSERR;
353} 354}
354 355
356
355/** 357/**
356 * Returns GNUNET_OK on OK, GNUNET_SYSERR on error 358 * @returns #GNUNET_OK on success, #GNUNET_SYSERR on error
357 */ 359 */
358int 360int
359EnumNICs3 (struct EnumNICs3_results **results, int *results_count) 361EnumNICs3 (struct EnumNICs3_results **results, int *results_count)
@@ -697,6 +699,7 @@ int InstallAsService(char *servicename, char *application, char *username)
697 return 0; 699 return 0;
698} 700}
699 701
702
700/** 703/**
701 * @brief Uninstall Windows service 704 * @brief Uninstall Windows service
702 * @param servicename name of the service to delete 705 * @param servicename name of the service to delete
@@ -706,7 +709,8 @@ int InstallAsService(char *servicename, char *application, char *username)
706 * 3 if the service cannot be accessed 709 * 3 if the service cannot be accessed
707 * 4 if the service cannot be deleted 710 * 4 if the service cannot be deleted
708 */ 711 */
709int UninstallService(char *servicename) 712int
713UninstallService(char *servicename)
710{ 714{
711 SC_HANDLE hManager, hService; 715 SC_HANDLE hManager, hService;
712 716
@@ -740,7 +744,8 @@ closeSCM:
740 * @see http://support.microsoft.com/?scid=kb;en-us;132958 744 * @see http://support.microsoft.com/?scid=kb;en-us;132958
741 * @date 12-Jul-95 745 * @date 12-Jul-95
742 */ 746 */
743void _InitLsaString(PLSA_UNICODE_STRING LsaString, LPWSTR String) 747void
748_InitLsaString(PLSA_UNICODE_STRING LsaString, LPWSTR String)
744{ 749{
745 DWORD StringLength; 750 DWORD StringLength;
746 751
@@ -764,7 +769,8 @@ void _InitLsaString(PLSA_UNICODE_STRING LsaString, LPWSTR String)
764 * @see http://support.microsoft.com/?scid=kb;en-us;132958 769 * @see http://support.microsoft.com/?scid=kb;en-us;132958
765 * @date 12-Jul-95 770 * @date 12-Jul-95
766 */ 771 */
767NTSTATUS _OpenPolicy(LPWSTR ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyHandle) 772NTSTATUS
773_OpenPolicy(LPWSTR ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyHandle)
768{ 774{
769 LSA_OBJECT_ATTRIBUTES ObjectAttributes; 775 LSA_OBJECT_ATTRIBUTES ObjectAttributes;
770 LSA_UNICODE_STRING ServerString; 776 LSA_UNICODE_STRING ServerString;
@@ -797,7 +803,8 @@ NTSTATUS _OpenPolicy(LPWSTR ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyH
797 * @remarks Call GetLastError() to obtain extended error information. 803 * @remarks Call GetLastError() to obtain extended error information.
798 * @see http://support.microsoft.com/?scid=kb;en-us;132958 804 * @see http://support.microsoft.com/?scid=kb;en-us;132958
799 */ 805 */
800BOOL _GetAccountSid(LPCTSTR SystemName, LPCTSTR AccountName, PSID * Sid) 806BOOL
807_GetAccountSid(LPCTSTR SystemName, LPCTSTR AccountName, PSID * Sid)
801{ 808{
802 LPTSTR ReferencedDomain = NULL; 809 LPTSTR ReferencedDomain = NULL;
803 DWORD cbSid = 128; /* initial allocation attempt */ 810 DWORD cbSid = 128; /* initial allocation attempt */
@@ -864,10 +871,11 @@ end:
864 * @see http://support.microsoft.com/?scid=kb;en-us;132958 871 * @see http://support.microsoft.com/?scid=kb;en-us;132958
865 * @date 12-Jul-95 872 * @date 12-Jul-95
866 */ 873 */
867NTSTATUS _SetPrivilegeOnAccount(LSA_HANDLE PolicyHandle,/* open policy handle */ 874NTSTATUS
868 PSID AccountSid, /* SID to grant privilege to */ 875_SetPrivilegeOnAccount(LSA_HANDLE PolicyHandle,/* open policy handle */
869 LPWSTR PrivilegeName, /* privilege to grant (Unicode) */ 876 PSID AccountSid, /* SID to grant privilege to */
870 BOOL bEnable /* enable or disable */ 877 LPWSTR PrivilegeName, /* privilege to grant (Unicode) */
878 BOOL bEnable /* enable or disable */
871 ) 879 )
872{ 880{
873 LSA_UNICODE_STRING PrivilegeString; 881 LSA_UNICODE_STRING PrivilegeString;
@@ -904,13 +912,14 @@ NTSTATUS _SetPrivilegeOnAccount(LSA_HANDLE PolicyHandle,/* open policy handle */
904 * @param pszName the name of the account 912 * @param pszName the name of the account
905 * @param pszDesc description of the account 913 * @param pszDesc description of the account
906 */ 914 */
907int CreateServiceAccount(const char *pszName, const char *pszDesc) 915int
916CreateServiceAccount(const char *pszName,
917 const char *pszDesc)
908{ 918{
909 USER_INFO_1 ui; 919 USER_INFO_1 ui;
910 USER_INFO_1008 ui2; 920 USER_INFO_1008 ui2;
911 NET_API_STATUS nStatus; 921 NET_API_STATUS nStatus;
912 wchar_t wszName[MAX_NAME_LENGTH], wszDesc[MAX_NAME_LENGTH]; 922 wchar_t wszName[MAX_NAME_LENGTH], wszDesc[MAX_NAME_LENGTH];
913 DWORD dwErr;
914 LSA_HANDLE hPolicy; 923 LSA_HANDLE hPolicy;
915 PSID pSID; 924 PSID pSID;
916 925