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
Expand all
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
This diff is collapsed.
Click to expand it.
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