Changeset 95863 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 27, 2022 1:10:09 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r95827 r95863 225 225 g_NotifyIconData.hIcon = hIcon; 226 226 227 sprintf(g_NotifyIconData.szTip, "%s Guest Additions %d.%d.%dr%d",228 VBOX_PRODUCT, VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV);227 RTStrPrintf(g_NotifyIconData.szTip, sizeof(g_NotifyIconData.szTip), "%s Guest Additions %d.%d.%dr%d", 228 VBOX_PRODUCT, VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV); 229 229 230 230 int rc = VINF_SUCCESS; … … 999 999 * Main function 1000 1000 */ 1001 #ifdef IPRT_NO_CRT 1002 int main(int cArgs, char **papszArgs) 1003 #else 1001 1004 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 1002 { 1005 #endif 1006 { 1007 char szLogFile[RTPATH_MAX] = {0}; 1008 1009 #ifdef IPRT_NO_CRT 1010 int rc = RTR3InitExe(cArgs, &papszArgs, RTR3INIT_FLAGS_STANDALONE_APP); 1011 if (RT_FAILURE(rc)) 1012 return RTMsgInitFailure(rc); 1013 #else 1003 1014 RT_NOREF(hPrevInstance, lpCmdLine, nCmdShow); 1004 1015 /** @todo r=bird: WTF do you use __argc & __argv here only to parse the 1016 * command line furthe down?!? Makes no effing sense, espcially given 1017 * that RTR3InitExe will return valid UTF-8, doing exactly the 1018 * same stuff as you do here. 1019 * aaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAARG! */ 1005 1020 int rc = RTR3InitExe(__argc, &__argv, RTR3INIT_FLAGS_STANDALONE_APP); 1006 1021 if (RT_FAILURE(rc)) … … 1016 1031 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to convert the command line: %Rrc", rc); 1017 1032 1018 char szLogFile[RTPATH_MAX] = {0};1019 1020 1033 int cArgs; 1021 1034 char **papszArgs; 1022 1035 rc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszCmdLine, RTGETOPTARGV_CNV_QUOTE_MS_CRT, NULL); 1023 1036 if (RT_SUCCESS(rc)) 1037 #endif 1024 1038 { 1025 1039 /* … … 1081 1095 rc = RTPathAbs(ValueUnion.psz, szLogFile, sizeof(szLogFile)); 1082 1096 if (RT_FAILURE(rc)) 1083 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Log file path is too long (%Rrc)", rc); 1097 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs failed on log file path: %Rrc (%s)", 1098 rc, ValueUnion.psz); 1084 1099 } 1085 1100 break; … … 1103 1118 RTGetOptArgvFree(papszArgs); 1104 1119 } 1120 #ifndef IPRT_NO_CRT 1105 1121 else 1106 1122 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvFromString failed: %Rrc", rc); 1123 #endif 1107 1124 1108 1125 /* Note: Do not use a global namespace ("Global\\") for mutex name here, … … 1131 1148 RTSYSTEM_NT_VERSION_GET_MINOR(uNtVersion), RTSYSTEM_NT_VERSION_GET_BUILD(uNtVersion), uNtVersion )); 1132 1149 1133 /* Save instance handle. */ 1150 /* Set the instance handle. */ 1151 #ifdef IPRT_NO_CRT 1152 g_hInstance = GetModuleHandleW(NULL); 1153 #else 1134 1154 g_hInstance = hInstance; 1155 #endif 1135 1156 1136 1157 hlpReportStatus(VBoxGuestFacilityStatus_Init);
Note:
See TracChangeset
for help on using the changeset viewer.