Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
77a19ed8
Commit
77a19ed8
authored
Mar 24, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace instances of HeapAlloc/MultiByteToWideChar with the internally
defined strdupAtoW.
parent
f8f64406
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
118 deletions
+76
-118
msi.c
dlls/msi/msi.c
+38
-73
msiquery.c
dlls/msi/msiquery.c
+4
-7
package.c
dlls/msi/package.c
+30
-34
preview.c
dlls/msi/preview.c
+4
-4
No files found.
dlls/msi/msi.c
View file @
77a19ed8
...
...
@@ -203,26 +203,21 @@ UINT WINAPI MsiOpenDatabaseA(LPCSTR szDBPath, LPCSTR szPersist, MSIHANDLE *phDB)
{
HRESULT
r
=
ERROR_FUNCTION_FAILED
;
LPWSTR
szwDBPath
=
NULL
,
szwPersist
=
NULL
;
UINT
len
;
TRACE
(
"%s %s %p
\n
"
,
debugstr_a
(
szDBPath
),
debugstr_a
(
szPersist
),
phDB
);
if
(
szDBPath
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szDBPath
,
-
1
,
NULL
,
0
);
szwDBPath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwDBPath
=
strdupAtoW
(
szDBPath
);
if
(
!
szwDBPath
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szDBPath
,
-
1
,
szwDBPath
,
len
);
}
if
(
HIWORD
(
szPersist
)
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szPersist
,
-
1
,
NULL
,
0
);
szwPersist
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwPersist
=
strdupAtoW
(
szPersist
);
if
(
!
szwPersist
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szPersist
,
-
1
,
szwPersist
,
len
);
}
else
szwPersist
=
(
LPWSTR
)
szPersist
;
...
...
@@ -238,17 +233,16 @@ end:
UINT
WINAPI
MsiOpenProductA
(
LPCSTR
szProduct
,
MSIHANDLE
*
phProduct
)
{
UINT
len
,
ret
;
UINT
ret
;
LPWSTR
szwProd
=
NULL
;
TRACE
(
"%s %p
\n
"
,
debugstr_a
(
szProduct
),
phProduct
);
if
(
szProduct
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
szwProd
)
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProd
,
len
);
szwProd
=
strdupAtoW
(
szProduct
);
if
(
!
szwProd
)
return
ERROR_OUTOFMEMORY
;
}
ret
=
MsiOpenProductW
(
szwProd
,
phProduct
);
...
...
@@ -353,20 +347,16 @@ UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
if
(
szPackagePath
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackagePath
,
-
1
,
NULL
,
0
);
szwPath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwPath
=
strdupAtoW
(
szPackagePath
);
if
(
!
szwPath
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackagePath
,
-
1
,
szwPath
,
len
);
}
if
(
szCommandLine
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szCommandLine
,
-
1
,
NULL
,
0
);
szwCommand
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwCommand
=
strdupAtoW
(
szCommandLine
);
if
(
!
szwCommand
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szCommandLine
,
-
1
,
szwCommand
,
len
);
}
r
=
MsiInstallProductW
(
szwPath
,
szwCommand
);
...
...
@@ -490,10 +480,10 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
goto
end
;
}
sz
=
strlenW
(
szInstalled
);
sz
=
l
strlenW
(
szInstalled
);
if
(
szCommandLine
)
sz
+=
strlenW
(
szCommandLine
);
sz
+=
l
strlenW
(
szCommandLine
);
commandline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
*
sizeof
(
WCHAR
));
...
...
@@ -525,20 +515,16 @@ UINT WINAPI MsiConfigureProductExA(LPCSTR szProduct, int iInstallLevel,
if
(
szProduct
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
}
if
(
szCommandLine
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szCommandLine
,
-
1
,
NULL
,
0
);
szwCommandLine
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwCommandLine
=
strdupAtoW
(
szCommandLine
);
if
(
!
szwCommandLine
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szCommandLine
,
-
1
,
szwCommandLine
,
len
);
}
hr
=
MsiConfigureProductExW
(
szwProduct
,
iInstallLevel
,
eInstallState
,
...
...
@@ -560,11 +546,9 @@ UINT WINAPI MsiConfigureProductA(LPCSTR szProduct, int iInstallLevel,
if
(
szProduct
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
}
hr
=
MsiConfigureProductW
(
szwProduct
,
iInstallLevel
,
eInstallState
);
...
...
@@ -594,11 +578,9 @@ UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer)
if
(
szComponent
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szComponent
,
-
1
,
NULL
,
0
);
szwComponent
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwComponent
=
strdupAtoW
(
szComponent
);
if
(
!
szwComponent
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szComponent
,
-
1
,
szwComponent
,
len
);
}
else
return
ERROR_INVALID_PARAMETER
;
...
...
@@ -635,22 +617,18 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute,
return
ERROR_INVALID_PARAMETER
;
if
(
szProduct
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
}
else
return
ERROR_INVALID_PARAMETER
;
if
(
szAttribute
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szAttribute
,
-
1
,
NULL
,
0
);
szwAttribute
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwAttribute
=
strdupAtoW
(
szAttribute
);
if
(
!
szwAttribute
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szAttribute
,
-
1
,
szwAttribute
,
len
);
}
else
{
...
...
@@ -722,11 +700,9 @@ UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes)
if
(
szLogFile
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szLogFile
,
-
1
,
NULL
,
0
);
szwLogFile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwLogFile
=
strdupAtoW
(
szLogFile
);
if
(
!
szwLogFile
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szLogFile
,
-
1
,
szwLogFile
,
len
);
}
else
return
ERROR_INVALID_PARAMETER
;
...
...
@@ -760,23 +736,25 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
INSTALLSTATE
WINAPI
MsiQueryProductStateA
(
LPCSTR
szProduct
)
{
LPWSTR
szwProduct
;
UINT
len
;
INSTALLSTATE
rc
;
LPWSTR
szwProduct
=
NULL
;
INSTALLSTATE
r
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
rc
=
MsiQueryProductStateW
(
szwProduct
);
HeapFree
(
GetProcessHeap
(),
0
,
szwProduct
);
return
rc
;
if
(
szProduct
)
{
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiQueryProductStateW
(
szwProduct
);
HeapFree
(
GetProcessHeap
(),
0
,
szwProduct
);
return
r
;
}
INSTALLSTATE
WINAPI
MsiQueryProductStateW
(
LPCWSTR
szProduct
)
{
UINT
rc
;
INSTALLSTATE
rrc
=
INSTALLSTATE_UNKNOWN
;
HKEY
hkey
=
0
;
HKEY
hkey
=
0
;
static
const
WCHAR
szWindowsInstaller
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
0
};
DWORD
sz
;
...
...
@@ -1043,18 +1021,16 @@ UINT WINAPI MsiGetProductPropertyW( MSIHANDLE hProduct, LPCWSTR szProperty,
UINT
WINAPI
MsiVerifyPackageA
(
LPCSTR
szPackage
)
{
UINT
r
,
len
;
UINT
r
;
LPWSTR
szPack
=
NULL
;
TRACE
(
"%s
\n
"
,
debugstr_a
(
szPackage
)
);
if
(
szPackage
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackage
,
-
1
,
NULL
,
0
);
szPack
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szPack
=
strdupAtoW
(
szPackage
);
if
(
!
szPack
)
return
ERROR_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackage
,
-
1
,
szPack
,
len
);
}
r
=
MsiVerifyPackageW
(
szPack
);
...
...
@@ -1082,27 +1058,23 @@ INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent,
{
LPWSTR
szwProduct
=
NULL
,
szwComponent
=
NULL
,
lpwPathBuf
=
NULL
;
INSTALLSTATE
rc
;
UINT
len
,
incoming_len
;
UINT
incoming_len
;
if
(
szProduct
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
return
ERROR_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
}
if
(
szComponent
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szComponent
,
-
1
,
NULL
,
0
);
szwComponent
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwComponent
=
strdupAtoW
(
szComponent
);
if
(
!
szwComponent
)
{
HeapFree
(
GetProcessHeap
(),
0
,
szwProduct
);
return
ERROR_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
szComponent
,
-
1
,
szwComponent
,
len
);
}
if
(
pcchBuf
&&
*
pcchBuf
>
0
)
...
...
@@ -1205,29 +1177,24 @@ end:
INSTALLSTATE
WINAPI
MsiQueryFeatureStateA
(
LPCSTR
szProduct
,
LPCSTR
szFeature
)
{
INSTALLSTATE
rc
;
UINT
len
;
LPWSTR
szwProduct
=
NULL
;
LPWSTR
szwFeature
=
NULL
;
if
(
szProduct
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
return
ERROR_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
}
if
(
szFeature
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szFeature
,
-
1
,
NULL
,
0
);
szwFeature
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwFeature
=
strdupAtoW
(
szFeature
);
if
(
!
szwFeature
)
{
HeapFree
(
GetProcessHeap
(),
0
,
szwProduct
);
return
ERROR_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
szFeature
,
-
1
,
szwFeature
,
len
);
}
rc
=
MsiQueryFeatureStateW
(
szwProduct
,
szwFeature
);
...
...
@@ -1251,15 +1218,13 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf,
DWORD
*
pcchVersionBuf
,
LPSTR
lpLangBuf
,
DWORD
*
pcchLangBuf
)
{
LPWSTR
szwFilePath
=
NULL
,
lpwVersionBuff
=
NULL
,
lpwLangBuff
=
NULL
;
UINT
len
,
ret
=
ERROR_OUTOFMEMORY
;
UINT
ret
=
ERROR_OUTOFMEMORY
;
if
(
szFilePath
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szFilePath
,
-
1
,
NULL
,
0
);
szwFilePath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwFilePath
=
strdupAtoW
(
szFilePath
);
if
(
!
szwFilePath
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szFilePath
,
-
1
,
szwFilePath
,
len
);
}
if
(
lpVersionBuf
&&
pcchVersionBuf
&&
*
pcchVersionBuf
)
...
...
dlls/msi/msiquery.c
View file @
77a19ed8
...
...
@@ -86,11 +86,9 @@ UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb,
if
(
szQuery
)
{
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szQuery
,
-
1
,
NULL
,
0
);
szwQuery
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
szwQuery
=
strdupAtoW
(
szQuery
);
if
(
!
szwQuery
)
return
ERROR_FUNCTION_FAILED
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szQuery
,
-
1
,
szwQuery
,
len
);
}
else
szwQuery
=
NULL
;
...
...
@@ -672,16 +670,15 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb,
LPCSTR
table
,
MSIHANDLE
*
phRec
)
{
LPWSTR
szwTable
=
NULL
;
DWORD
len
;
UINT
r
;
TRACE
(
"%ld %s %p
\n
"
,
hdb
,
debugstr_a
(
table
),
phRec
);
if
(
table
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
table
,
-
1
,
NULL
,
0
);
szwTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
table
,
-
1
,
szwTable
,
len
)
;
szwTable
=
strdupAtoW
(
table
);
if
(
!
szwTable
)
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiDatabaseGetPrimaryKeysW
(
hdb
,
szwTable
,
phRec
);
HeapFree
(
GetProcessHeap
(),
0
,
szwTable
);
...
...
dlls/msi/package.c
View file @
77a19ed8
...
...
@@ -469,14 +469,13 @@ UINT WINAPI MsiOpenPackageW(LPCWSTR szPackage, MSIHANDLE *phPackage)
UINT
WINAPI
MsiOpenPackageExA
(
LPCSTR
szPackage
,
DWORD
dwOptions
,
MSIHANDLE
*
phPackage
)
{
LPWSTR
szwPack
=
NULL
;
UINT
len
,
ret
;
UINT
ret
;
if
(
szPackage
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackage
,
-
1
,
NULL
,
0
);
szwPack
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
szwPack
)
MultiByteToWideChar
(
CP_ACP
,
0
,
szPackage
,
-
1
,
szwPack
,
len
);
szwPack
=
strdupAtoW
(
szPackage
);
if
(
!
szwPack
)
return
ERROR_OUTOFMEMORY
;
}
ret
=
MsiOpenPackageExW
(
szwPack
,
dwOptions
,
phPackage
);
...
...
@@ -638,29 +637,20 @@ UINT WINAPI MsiSetPropertyA( MSIHANDLE hInstall, LPCSTR szName, LPCSTR szValue)
{
LPWSTR
szwName
=
NULL
,
szwValue
=
NULL
;
UINT
hr
=
ERROR_INSTALL_FAILURE
;
UINT
len
;
if
(
0
==
hInstall
)
{
return
ERROR_INVALID_HANDLE
;
}
if
(
NULL
==
szName
)
{
return
ERROR_INVALID_PARAMETER
;
}
if
(
NULL
==
szValue
)
{
return
ERROR_INVALID_PARAMETER
;
if
(
szName
)
{
szwName
=
strdupAtoW
(
szName
);
if
(
!
szwName
)
goto
end
;
}
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
NULL
,
0
);
szwName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
szwName
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
szwName
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szValue
,
-
1
,
NULL
,
0
);
szwValue
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
szwValue
)
goto
end
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szValue
,
-
1
,
szwValue
,
len
);
if
(
szValue
)
{
szwValue
=
strdupAtoW
(
szValue
);
if
(
!
szwValue
)
goto
end
;
}
hr
=
MsiSetPropertyW
(
hInstall
,
szwName
,
szwValue
);
...
...
@@ -703,7 +693,7 @@ UINT MSI_SetPropertyW( MSIPACKAGE *package, LPCWSTR szName, LPCWSTR szValue)
}
else
{
strcpyW
(
Query
,
Insert
);
strcpyW
(
Query
,
Insert
);
row
=
MSI_CreateRecord
(
2
);
MSI_RecordSetStringW
(
row
,
1
,
szName
);
...
...
@@ -732,8 +722,13 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue
MSIPACKAGE
*
package
;
UINT
ret
;
if
(
NULL
==
szName
)
return
ERROR_INVALID_PARAMETER
;
if
(
NULL
==
szValue
)
return
ERROR_INVALID_PARAMETER
;
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
ret
=
MSI_SetPropertyW
(
package
,
szName
,
szValue
);
msiobj_release
(
&
package
->
hdr
);
...
...
@@ -808,17 +803,18 @@ UINT MSI_GetPropertyA(MSIPACKAGE *package, LPCSTR szName,
LPSTR
szValueBuf
,
DWORD
*
pchValueBuf
)
{
MSIRECORD
*
row
;
UINT
rc
,
len
;
LPWSTR
szwName
;
UINT
rc
;
LPWSTR
szwName
=
NULL
;
if
(
*
pchValueBuf
>
0
)
szValueBuf
[
0
]
=
0
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
NULL
,
0
);
szwName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
szwName
)
return
ERROR_NOT_ENOUGH_MEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
szwName
,
len
);
if
(
szName
)
{
szwName
=
strdupAtoW
(
szName
);
if
(
!
szwName
)
return
ERROR_NOT_ENOUGH_MEMORY
;
}
rc
=
MSI_GetPropertyRow
(
package
,
szwName
,
&
row
);
if
(
rc
==
ERROR_SUCCESS
)
...
...
dlls/msi/preview.c
View file @
77a19ed8
...
...
@@ -132,16 +132,16 @@ UINT WINAPI MsiPreviewDialogW( MSIHANDLE hPreview, LPCWSTR szDialogName )
UINT
WINAPI
MsiPreviewDialogA
(
MSIHANDLE
hPreview
,
LPCSTR
szDialogName
)
{
UINT
r
,
len
;
UINT
r
;
LPWSTR
strW
=
NULL
;
TRACE
(
"%ld %s
\n
"
,
hPreview
,
debugstr_a
(
szDialogName
));
if
(
szDialogName
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szDialogName
,
-
1
,
NULL
,
0
);
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szDialogName
,
-
1
,
strW
,
len
)
;
strW
=
strdupAtoW
(
szDialogName
);
if
(
!
strW
)
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiPreviewDialogW
(
hPreview
,
strW
);
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment