VirtualBox

Ignore:
Timestamp:
Sep 19, 2011 1:21:31 PM (13 years ago)
Author:
vboxsync
Message:

VBoxInstallHelper.cpp,++: Clean up TCHAR/WCHAR mess - just use WCHAR, forget TCHAR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp

    r37289 r38791  
    55
    66/*
    7  * Copyright (C) 2008-2010 Oracle Corporation
     7 * Copyright (C) 2008-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
     18
     19/*******************************************************************************
     20*   Header Files                                                               *
     21*******************************************************************************/
    1822#include <windows.h>
    1923#include <tchar.h>
     
    2428
    2529
    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. */
     31int swprintf_s(WCHAR *buffer, size_t cbBuffer, const WCHAR *format, ...)
    2832{
    2933    int ret;
    30     va_list args;
    31     va_start(args, format);
    32     ret = _vsntprintf(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);
    3438    return ret;
    3539}
    3640#endif
    3741
    38 UINT VBoxGetProperty(MSIHANDLE a_hModule, TCHAR* a_pszName, TCHAR* a_pValue, DWORD a_dwSize)
     42UINT VBoxGetProperty(MSIHANDLE a_hModule, WCHAR *a_pwszName, WCHAR *a_pwszValue, DWORD a_dwSize)
    3943{
    40     UINT uiRet = ERROR_SUCCESS;
    4144    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)
    4547    {
    4648        ++dwBuffer;     /* On output does not include terminating null, so add 1. */
     
    4951            return ERROR_MORE_DATA;
    5052
    51         ZeroMemory(a_pValue, 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);
    5355    }
    5456    return uiRet;
    5557}
    5658
    57 UINT VBoxSetProperty(MSIHANDLE a_hModule, TCHAR* a_pszName, TCHAR* a_pValue)
     59UINT VBoxSetProperty(MSIHANDLE a_hModule, WCHAR *a_pwszName, WCHAR *a_pwszValue)
    5860{
    59     return MsiSetProperty(a_hModule, a_pszName, a_pValue);
     61    return MsiSetPropertyW(a_hModule, a_pwszName, a_pwszValue);
    6062}
    6163
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette