Changeset 108458 in vbox for trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
- Timestamp:
- Mar 5, 2025 4:57:50 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 167832
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r108457 r108458 1730 1730 } 1731 1731 1732 static DECLCALLBACK(void) netCfgLoggerCallback(const char *pszString)1733 {1734 if (g_hCurrentModule)1735 logStringF(g_hCurrentModule, "%s", pszString);1736 }1737 1738 static VOID netCfgLoggerDisable()1739 {1740 if (g_hCurrentModule)1741 {1742 VBoxNetCfgWinSetLogging(NULL);1743 g_hCurrentModule = NULL;1744 }1745 }1746 1747 static VOID netCfgLoggerEnable(MSIHANDLE hModule)1748 {1749 NonStandardAssert(hModule);1750 1751 if (g_hCurrentModule)1752 netCfgLoggerDisable();1753 1754 g_hCurrentModule = hModule;1755 1756 VBoxNetCfgWinSetLogging(netCfgLoggerCallback);1757 /* uncomment next line if you want to add logging information from VBoxDrvCfg.cpp */1758 // VBoxDrvCfgLoggerSet(vboxDrvLoggerCallback, NULL);1759 }1760 1761 1732 static UINT errorConvertFromHResult(MSIHANDLE hModule, HRESULT hr) 1762 1733 { … … 1785 1756 } 1786 1757 1787 static MSIHANDLE createNetCfgLockedMsgRecord(MSIHANDLE hModule) 1758 static DECLCALLBACK(void) netCfgLoggerCallback(const char *pszString) 1759 { 1760 if (g_hCurrentModule) 1761 logStringF(g_hCurrentModule, "%s", pszString); 1762 } 1763 1764 static VOID netCfgLoggerDisable() 1765 { 1766 if (g_hCurrentModule) 1767 { 1768 VBoxNetCfgWinSetLogging(NULL); 1769 g_hCurrentModule = NULL; 1770 } 1771 } 1772 1773 static VOID netCfgLoggerEnable(MSIHANDLE hModule) 1774 { 1775 NonStandardAssert(hModule); 1776 1777 if (g_hCurrentModule) 1778 netCfgLoggerDisable(); 1779 1780 g_hCurrentModule = hModule; 1781 1782 VBoxNetCfgWinSetLogging(netCfgLoggerCallback); 1783 /* uncomment next line if you want to add logging information from VBoxDrvCfg.cpp */ 1784 // VBoxDrvCfgLoggerSet(vboxDrvLoggerCallback, NULL); 1785 } 1786 1787 static MSIHANDLE netCfgCreateLockedMsgRecord(MSIHANDLE hModule) 1788 1788 { 1789 1789 MSIHANDLE hRecord = MsiCreateRecord(2); … … 1793 1793 if (uErr != ERROR_SUCCESS) 1794 1794 { 1795 logStringF(hModule, " createNetCfgLockedMsgRecord: MsiRecordSetInteger failed, error = %#x", uErr);1795 logStringF(hModule, "netCfgCreateLockedMsgRecord: MsiRecordSetInteger failed, error = %#x", uErr); 1796 1796 MsiCloseHandle(hRecord); 1797 1797 hRecord = NULL; … … 1799 1799 } 1800 1800 else 1801 logStringF(hModule, " createNetCfgLockedMsgRecord: Failed to create a record");1801 logStringF(hModule, "netCfgCreateLockedMsgRecord: Failed to create a record"); 1802 1802 1803 1803 return hRecord; 1804 1804 } 1805 1805 1806 static UINT doNetCfgInit(MSIHANDLE hModule, INetCfg **ppnc, BOOL bWrite)1806 static UINT netCfgInit(MSIHANDLE hModule, INetCfg **ppnc, BOOL bWrite) 1807 1807 { 1808 1808 MSIHANDLE hMsg = NULL; … … 1818 1818 { 1819 1819 if (FAILED(hr)) 1820 logStringF(hModule, " doNetCfgInit: VBoxNetCfgWinQueryINetCfg failed, error = %#x", hr);1820 logStringF(hModule, "netCfgInit: VBoxNetCfgWinQueryINetCfg failed, error = %#x", hr); 1821 1821 uErr = errorConvertFromHResult(hModule, hr); 1822 1822 break; … … 1827 1827 if (!lpszLockedBy) 1828 1828 { 1829 logStringF(hModule, " doNetCfgInit: lpszLockedBy == NULL, breaking");1829 logStringF(hModule, "netCfgInit: lpszLockedBy == NULL, breaking"); 1830 1830 break; 1831 1831 } … … 1841 1841 { 1842 1842 cRetries++; 1843 logStringF(hModule, " doNetCfgInit: lpszLockedBy is 6to4svc.dll, retrying %d out of %d", cRetries, VBOX_NETCFG_MAX_RETRIES);1843 logStringF(hModule, "netCfgInit: lpszLockedBy is 6to4svc.dll, retrying %d out of %d", cRetries, VBOX_NETCFG_MAX_RETRIES); 1844 1844 MsgResult = IDRETRY; 1845 1845 } … … 1848 1848 if (!hMsg) 1849 1849 { 1850 hMsg = createNetCfgLockedMsgRecord(hModule);1850 hMsg = netCfgCreateLockedMsgRecord(hModule); 1851 1851 if (!hMsg) 1852 1852 { 1853 logStringF(hModule, " doNetCfgInit: Failed to create a message record, breaking");1853 logStringF(hModule, "netCfgInit: Failed to create a message record, breaking"); 1854 1854 CoTaskMemFree(lpszLockedBy); 1855 1855 break; … … 1861 1861 if (rTmp != ERROR_SUCCESS) 1862 1862 { 1863 logStringF(hModule, " doNetCfgInit: MsiRecordSetStringW failed, error = #%x", rTmp);1863 logStringF(hModule, "netCfgInit: MsiRecordSetStringW failed, error = #%x", rTmp); 1864 1864 CoTaskMemFree(lpszLockedBy); 1865 1865 break; … … 1868 1868 MsgResult = MsiProcessMessage(hModule, (INSTALLMESSAGE)(INSTALLMESSAGE_USER | MB_RETRYCANCEL), hMsg); 1869 1869 NonStandardAssert(MsgResult == IDRETRY || MsgResult == IDCANCEL); 1870 logStringF(hModule, " doNetCfgInit: MsiProcessMessage returned (%#x)", MsgResult);1870 logStringF(hModule, "netCfgInit: MsiProcessMessage returned (%#x)", MsgResult); 1871 1871 } 1872 1872 CoTaskMemFree(lpszLockedBy); … … 1924 1924 logStringF(hModule, "Uninstalling NetLwf"); 1925 1925 1926 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);1926 uErr = netCfgInit(hModule, &pNetCfg, TRUE); 1927 1927 if (uErr == ERROR_SUCCESS) 1928 1928 { … … 1938 1938 } 1939 1939 else 1940 logStringF(hModule, "UninstallNetLwf: doNetCfgInit failed, error = %#x", uErr);1940 logStringF(hModule, "UninstallNetLwf: netCfgInit failed, error = %#x", uErr); 1941 1941 } 1942 1942 __finally … … 1980 1980 logStringF(hModule, "InstallNetLwf: Installing NetLwf"); 1981 1981 1982 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);1982 uErr = netCfgInit(hModule, &pNetCfg, TRUE); 1983 1983 if (uErr == ERROR_SUCCESS) 1984 1984 { … … 2019 2019 } 2020 2020 else 2021 logStringF(hModule, "InstallNetLwf: doNetCfgInit failed, error = %#x", uErr);2021 logStringF(hModule, "InstallNetLwf: netCfgInit failed, error = %#x", uErr); 2022 2022 } 2023 2023 __finally … … 2357 2357 logStringF(hModule, "Uninstalling NetAdp"); 2358 2358 2359 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);2359 uErr = netCfgInit(hModule, &pNetCfg, TRUE); 2360 2360 if (uErr == ERROR_SUCCESS) 2361 2361 { … … 2371 2371 } 2372 2372 else 2373 logStringF(hModule, "UninstallNetAdp: doNetCfgInit failed, error = %#x", uErr);2373 logStringF(hModule, "UninstallNetAdp: netCfgInit failed, error = %#x", uErr); 2374 2374 } 2375 2375 __finally
Note:
See TracChangeset
for help on using the changeset viewer.