@@ -185,9 +185,9 @@ find_adapters(_In_ MSIHANDLE hInstall, _In_z_ LPCWSTR szzHardwareIDs,
185185 free (pAdapterAdresses );
186186 if (ulResult != ERROR_BUFFER_OVERFLOW )
187187 {
188- SetLastError (
189- ulResult ); /* MSDN does not mention GetAdaptersAddresses() to set GetLastError().
190- But we do have an error code. Set last error manually. */
188+ /* MSDN does not mention GetAdaptersAddresses() to set GetLastError().
189+ * But we do have an error code. Set last error manually. */
190+ SetLastError ( ulResult );
191191 msg (M_NONFATAL | M_ERRNO , "%s: GetAdaptersAddresses() failed" , __FUNCTION__ );
192192 uiResult = ulResult ;
193193 goto cleanup_pAdapterList ;
@@ -290,8 +290,9 @@ find_adapters(_In_ MSIHANDLE hInstall, _In_z_ LPCWSTR szzHardwareIDs,
290290 uiResult = MsiSetProperty (hInstall , szActiveAdaptersPropertyName , szAdaptersActive );
291291 if (uiResult != ERROR_SUCCESS )
292292 {
293- SetLastError (uiResult ); /* MSDN does not mention MsiSetProperty() to set GetLastError(). But
294- we do have an error code. Set last error manually. */
293+ /* MSDN does not mention MsiSetProperty() to set GetLastError(). But
294+ * we do have an error code. Set last error manually. */
295+ SetLastError (uiResult );
295296 msg (M_NONFATAL | M_ERRNO , "%s: MsiSetProperty(\"%s\") failed" , __FUNCTION__ ,
296297 szActiveAdaptersPropertyName );
297298 goto cleanup_szAdaptersActive ;
@@ -386,8 +387,9 @@ StartOpenVPNGUI(_In_ MSIHANDLE hInstall)
386387 uiResult = MsiRecordSetString (hRecord , 0 , L"\"[#bin.openvpn_gui.exe]\"" );
387388 if (uiResult != ERROR_SUCCESS )
388389 {
389- SetLastError (uiResult ); /* MSDN does not mention MsiRecordSetString() to set GetLastError().
390- But we do have an error code. Set last error manually. */
390+ /* MSDN does not mention MsiRecordSetString() to set GetLastError().
391+ * But we do have an error code. Set last error manually. */
392+ SetLastError (uiResult );
391393 msg (M_NONFATAL | M_ERRNO , "%s: MsiRecordSetString failed" , __FUNCTION__ );
392394 goto cleanup_MsiCreateRecord ;
393395 }
@@ -412,16 +414,17 @@ StartOpenVPNGUI(_In_ MSIHANDLE hInstall)
412414 }
413415 if (uiResult != ERROR_SUCCESS )
414416 {
415- SetLastError (uiResult ); /* MSDN does not mention MsiFormatRecord() to set GetLastError().
416- But we do have an error code. Set last error manually. */
417+ /* MSDN does not mention MsiFormatRecord() to set GetLastError().
418+ * But we do have an error code. Set last error manually. */
419+ SetLastError (uiResult );
417420 msg (M_NONFATAL | M_ERRNO , "%s: MsiFormatRecord failed" , __FUNCTION__ );
418421 goto cleanup_malloc_szPath ;
419422 }
420423
421424 /* Launch the OpenVPN GUI. */
422425 SHELLEXECUTEINFO sei = { .cbSize = sizeof (SHELLEXECUTEINFO ),
423- . fMask =
424- SEE_MASK_FLAG_NO_UI , /* Don't show error UI, we'll display it. */
426+ /* Don't show error UI, we'll display it. */
427+ . fMask = SEE_MASK_FLAG_NO_UI ,
425428 .lpFile = szPath ,
426429 .nShow = SW_SHOWNORMAL };
427430 if (!ShellExecuteEx (& sei ))
@@ -528,7 +531,8 @@ schedule_adapter_create(_Inout_ struct msica_arg_seq *seq,
528531 break ;
529532 }
530533 }
531- break ; /* Adapter names are unique. There should be no other adapter with this name. */
534+ /* Adapter names are unique. There should be no other adapter with this name. */
535+ break ;
532536 }
533537 }
534538
@@ -614,7 +618,8 @@ schedule_adapter_delete(_Inout_ struct msica_arg_seq *seq,
614618 }
615619
616620 * iTicks += MSICA_ADAPTER_TICK_SIZE ;
617- break ; /* Adapter names are unique. There should be no other adapter with this name. */
621+ /* Adapter names are unique. There should be no other adapter with this name. */
622+ break ;
618623 }
619624 }
620625
@@ -678,9 +683,9 @@ EvaluateTUNTAPAdapters(_In_ MSIHANDLE hInstall)
678683 uiResult = MsiDatabaseOpenView (hDatabase , szQuery , & hViewST );
679684 if (uiResult != ERROR_SUCCESS )
680685 {
681- SetLastError (
682- uiResult ); /* MSDN does not mention MsiDatabaseOpenView() to set GetLastError(). But we
683- do have an error code. Set last error manually. */
686+ /* MSDN does not mention MsiDatabaseOpenView() to set GetLastError(). But we
687+ * do have an error code. Set last error manually. */
688+ SetLastError ( uiResult );
684689 msg (M_NONFATAL | M_ERRNO , "%s: MsiDatabaseOpenView(\"%ls\") failed" , __FUNCTION__ , szQuery );
685690 goto cleanup_hDatabase ;
686691 }
@@ -689,8 +694,9 @@ EvaluateTUNTAPAdapters(_In_ MSIHANDLE hInstall)
689694 uiResult = MsiViewExecute (hViewST , 0 );
690695 if (uiResult != ERROR_SUCCESS )
691696 {
692- SetLastError (uiResult ); /* MSDN does not mention MsiViewExecute() to set GetLastError(). But
693- we do have an error code. Set last error manually. */
697+ /* MSDN does not mention MsiViewExecute() to set GetLastError(). But
698+ * we do have an error code. Set last error manually. */
699+ SetLastError (uiResult );
694700 msg (M_NONFATAL | M_ERRNO , "%s: MsiViewExecute(\"%ls\") failed" , __FUNCTION__ , szQuery );
695701 goto cleanup_hViewST ;
696702 }
@@ -715,8 +721,9 @@ EvaluateTUNTAPAdapters(_In_ MSIHANDLE hInstall)
715721 }
716722 else if (uiResult != ERROR_SUCCESS )
717723 {
718- SetLastError (uiResult ); /* MSDN does not mention MsiViewFetch() to set GetLastError().
719- But we do have an error code. Set last error manually. */
724+ /* MSDN does not mention MsiViewFetch() to set GetLastError().
725+ * But we do have an error code. Set last error manually. */
726+ SetLastError (uiResult );
720727 msg (M_NONFATAL | M_ERRNO , "%s: MsiViewFetch failed" , __FUNCTION__ );
721728 goto cleanup_hRecordProg ;
722729 }
@@ -735,9 +742,10 @@ EvaluateTUNTAPAdapters(_In_ MSIHANDLE hInstall)
735742 uiResult = MsiGetComponentState (hInstall , szValue , & iInstalled , & iAction );
736743 if (uiResult != ERROR_SUCCESS )
737744 {
738- SetLastError (uiResult ); /* MSDN does not mention MsiGetComponentState() to set
739- GetLastError(). But we do have an error code. Set last
740- error manually. */
745+ /* MSDN does not mention MsiGetComponentState() to set
746+ * GetLastError(). But we do have an error code. Set last
747+ * error manually. */
748+ SetLastError (uiResult );
741749 msg (M_NONFATAL | M_ERRNO , "%s: MsiGetComponentState(\"%ls\") failed" , __FUNCTION__ ,
742750 szValue );
743751 free (szValue );
0 commit comments