Changeset 38791 in vbox for trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
- Timestamp:
- Sep 19, 2011 1:21:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
r37289 r38791 5 5 6 6 /* 7 * Copyright (C) 2008-201 0Oracle Corporation7 * Copyright (C) 2008-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 19 /******************************************************************************* 20 * Header Files * 21 *******************************************************************************/ 18 22 #include <windows.h> 19 23 #include <tchar.h> … … 24 28 25 29 26 #if (_MSC_VER < 1400) /* Provide _stprintf_s to VC < 8.0. */27 int _stprintf_s(TCHAR *buffer, size_t cbBuffer, const TCHAR *format, ...)30 #if (_MSC_VER < 1400) /* Provide swprintf_s to VC < 8.0. */ 31 int swprintf_s(WCHAR *buffer, size_t cbBuffer, const WCHAR *format, ...) 28 32 { 29 33 int ret; 30 va_list args;31 va_start( args, format);32 ret = _vsn tprintf(buffer, cbBuffer, format, args);33 va_end( args);34 va_list va; 35 va_start(va, format); 36 ret = _vsnwprintf(buffer, cbBuffer, format, va); 37 va_end(va); 34 38 return ret; 35 39 } 36 40 #endif 37 41 38 UINT VBoxGetProperty(MSIHANDLE a_hModule, TCHAR* a_pszName, TCHAR* a_pValue, DWORD a_dwSize)42 UINT VBoxGetProperty(MSIHANDLE a_hModule, WCHAR *a_pwszName, WCHAR *a_pwszValue, DWORD a_dwSize) 39 43 { 40 UINT uiRet = ERROR_SUCCESS;41 44 DWORD dwBuffer = 0; 42 43 uiRet = MsiGetProperty(a_hModule, a_pszName, TEXT(""), &dwBuffer); 44 if (ERROR_MORE_DATA == uiRet) 45 UINT uiRet = MsiGetPropertyW(a_hModule, a_pwszName, L"", &dwBuffer); 46 if (uiRet == ERROR_MORE_DATA) 45 47 { 46 48 ++dwBuffer; /* On output does not include terminating null, so add 1. */ … … 49 51 return ERROR_MORE_DATA; 50 52 51 ZeroMemory(a_p Value, a_dwSize);52 uiRet = MsiGetProperty (a_hModule, a_pszName, a_pValue, &dwBuffer);53 ZeroMemory(a_pwszValue, a_dwSize); 54 uiRet = MsiGetPropertyW(a_hModule, a_pwszName, a_pwszValue, &dwBuffer); 53 55 } 54 56 return uiRet; 55 57 } 56 58 57 UINT VBoxSetProperty(MSIHANDLE a_hModule, TCHAR* a_pszName, TCHAR* a_pValue)59 UINT VBoxSetProperty(MSIHANDLE a_hModule, WCHAR *a_pwszName, WCHAR *a_pwszValue) 58 60 { 59 return MsiSetProperty (a_hModule, a_pszName, a_pValue);61 return MsiSetPropertyW(a_hModule, a_pwszName, a_pwszValue); 60 62 } 61 63
Note:
See TracChangeset
for help on using the changeset viewer.