summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/sellang/sellang.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source/win32/customactions/sellang/sellang.cxx')
-rw-r--r--setup_native/source/win32/customactions/sellang/sellang.cxx21
1 files changed, 3 insertions, 18 deletions
diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx
index b6f7ec559ea0..893a04f386a4 100644
--- a/setup_native/source/win32/customactions/sellang/sellang.cxx
+++ b/setup_native/source/win32/customactions/sellang/sellang.cxx
@@ -28,7 +28,7 @@
#define WINVER 0x0500
#include <windows.h>
-#include <msiquery.h>
+#include <../tools/msiprop.hxx>
#include <malloc.h>
#include <stdio.h>
@@ -40,21 +40,6 @@
#include "spellchecker_selection.hxx"
-BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue )
-{
- DWORD sz = 0;
- if ( MsiGetProperty( hMSI, pPropName, "", &sz ) == ERROR_MORE_DATA ) {
- sz++;
- DWORD nbytes = sz * sizeof( char );
- char* buff = reinterpret_cast<char*>( malloc( nbytes ) );
- ZeroMemory( buff, nbytes );
- MsiGetProperty( hMSI, pPropName, buff, &sz );
- *ppValue = buff;
- return ( strlen(buff) > 0 );
- }
- return FALSE;
-}
-
static const char *
langid_to_string( LANGID langid )
{
@@ -314,8 +299,8 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
/* Keep track of what UI languages are relevant, either the ones explicitly
* requested with the UI_LANGS property, or all available on the system:
*/
- char* pVal = NULL;
- if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) && pVal ) {
+ LPTSTR pVal = NULL;
+ if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) ) {
char *str_ptr;
str_ptr = strtok(pVal, ",");
for(; str_ptr != NULL ;) {