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
95dea496
Commit
95dea496
authored
Mar 16, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Rename dupstrW to strdupW, and remove duplicate definition.
- Move definition of string manipulation functions to msipriv.h.
parent
12bbaa7b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
72 deletions
+62
-72
action.c
dlls/msi/action.c
+17
-17
action.h
dlls/msi/action.h
+0
-36
custom.c
dlls/msi/custom.c
+5
-5
dialog.c
dlls/msi/dialog.c
+4
-4
format.c
dlls/msi/format.c
+1
-1
msipriv.h
dlls/msi/msipriv.h
+35
-0
table.c
dlls/msi/table.c
+0
-9
No files found.
dlls/msi/action.c
View file @
95dea496
...
...
@@ -508,8 +508,8 @@ int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path)
memset
(
&
package
->
files
[
index
],
0
,
sizeof
(
MSIFILE
));
package
->
files
[
index
].
File
=
dupstr
W
(
name
);
package
->
files
[
index
].
TargetPath
=
dupstr
W
(
path
);
package
->
files
[
index
].
File
=
strdup
W
(
name
);
package
->
files
[
index
].
TargetPath
=
strdup
W
(
path
);
package
->
files
[
index
].
Temporary
=
TRUE
;
TRACE
(
"Tracking tempfile (%s)
\n
"
,
debugstr_w
(
package
->
files
[
index
].
File
));
...
...
@@ -677,7 +677,7 @@ static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * recor
package
->
ActionFormat
=
load_dynamic_stringW
(
row
,
3
);
HeapFree
(
GetProcessHeap
(),
0
,
package
->
LastAction
);
package
->
LastAction
=
dupstr
W
(
action
);
package
->
LastAction
=
strdup
W
(
action
);
msiobj_release
(
&
row
->
hdr
);
MSI_ViewClose
(
view
);
...
...
@@ -875,8 +875,8 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
{
LPWSTR
p
,
check
,
path
;
package
->
PackagePath
=
dupstr
W
(
szPackagePath
);
path
=
dupstr
W
(
szPackagePath
);
package
->
PackagePath
=
strdup
W
(
szPackagePath
);
path
=
strdup
W
(
szPackagePath
);
p
=
strrchrW
(
path
,
'\\'
);
if
(
p
)
{
...
...
@@ -1921,7 +1921,7 @@ static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
memset
(
&
package
->
folders
[
index
],
0
,
sizeof
(
MSIFOLDER
));
package
->
folders
[
index
].
Directory
=
dupstr
W
(
dir
);
package
->
folders
[
index
].
Directory
=
strdup
W
(
dir
);
rc
=
MSI_OpenQuery
(
package
->
db
,
&
view
,
Query
,
dir
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
@@ -1980,13 +1980,13 @@ static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
{
TRACE
(
" TargetDefault = %s
\n
"
,
debugstr_w
(
targetdir
));
HeapFree
(
GetProcessHeap
(),
0
,
package
->
folders
[
index
].
TargetDefault
);
package
->
folders
[
index
].
TargetDefault
=
dupstr
W
(
targetdir
);
package
->
folders
[
index
].
TargetDefault
=
strdup
W
(
targetdir
);
}
if
(
srcdir
)
package
->
folders
[
index
].
SourceDefault
=
dupstr
W
(
srcdir
);
package
->
folders
[
index
].
SourceDefault
=
strdup
W
(
srcdir
);
else
if
(
targetdir
)
package
->
folders
[
index
].
SourceDefault
=
dupstr
W
(
targetdir
);
package
->
folders
[
index
].
SourceDefault
=
strdup
W
(
targetdir
);
HeapFree
(
GetProcessHeap
(),
0
,
ptargetdir
);
parent
=
load_dynamic_stringW
(
row
,
2
);
...
...
@@ -2084,13 +2084,13 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
if
(
!
source
&&
package
->
folders
[
i
].
ResolvedTarget
)
{
path
=
dupstr
W
(
package
->
folders
[
i
].
ResolvedTarget
);
path
=
strdup
W
(
package
->
folders
[
i
].
ResolvedTarget
);
TRACE
(
" already resolved to %s
\n
"
,
debugstr_w
(
path
));
return
path
;
}
else
if
(
source
&&
package
->
folders
[
i
].
ResolvedSource
)
{
path
=
dupstr
W
(
package
->
folders
[
i
].
ResolvedSource
);
path
=
strdup
W
(
package
->
folders
[
i
].
ResolvedSource
);
return
path
;
}
else
if
(
!
source
&&
package
->
folders
[
i
].
Property
)
...
...
@@ -2114,7 +2114,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
{
TRACE
(
" TargetDefault = %s
\n
"
,
debugstr_w
(
package
->
folders
[
i
].
TargetDefault
));
path
=
build_directory_name
(
3
,
p
,
package
->
folders
[
i
].
TargetDefault
,
NULL
);
package
->
folders
[
i
].
ResolvedTarget
=
dupstr
W
(
path
);
package
->
folders
[
i
].
ResolvedTarget
=
strdup
W
(
path
);
TRACE
(
" resolved into %s
\n
"
,
debugstr_w
(
path
));
if
(
set_prop
)
MSI_SetPropertyW
(
package
,
name
,
path
);
...
...
@@ -2122,7 +2122,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
else
{
path
=
build_directory_name
(
3
,
p
,
package
->
folders
[
i
].
SourceDefault
,
NULL
);
package
->
folders
[
i
].
ResolvedSource
=
dupstr
W
(
path
);
package
->
folders
[
i
].
ResolvedSource
=
strdup
W
(
path
);
}
HeapFree
(
GetProcessHeap
(),
0
,
p
);
}
...
...
@@ -3119,7 +3119,7 @@ inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
{
if
(
package
->
files
[
index
].
State
>=
2
)
{
*
file_source
=
dupstr
W
(
package
->
files
[
index
].
TargetPath
);
*
file_source
=
strdup
W
(
package
->
files
[
index
].
TargetPath
);
return
ERROR_SUCCESS
;
}
else
...
...
@@ -3231,7 +3231,7 @@ static UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
if
(
MSI_RecordIsNull
(
row
,
5
))
{
LPWSTR
p
;
dest_path
=
dupstr
W
(
file_source
);
dest_path
=
strdup
W
(
file_source
);
p
=
strrchrW
(
dest_path
,
'\\'
);
if
(
p
)
*
p
=
0
;
...
...
@@ -3759,7 +3759,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, INT
if
(
j
>=
0
)
{
LPWSTR
p
=
dupstr
W
(
package
->
files
[
j
].
TargetPath
);
LPWSTR
p
=
strdup
W
(
package
->
files
[
j
].
TargetPath
);
return
p
;
}
}
...
...
@@ -4882,7 +4882,7 @@ static UINT ACTION_CreateShortcuts(MSIPACKAGE *package)
{
LPWSTR
keypath
;
FIXME
(
"poorly handled shortcut format, advertised shortcut
\n
"
);
keypath
=
dupstr
W
(
package
->
components
[
index
].
FullKeypath
);
keypath
=
strdup
W
(
package
->
components
[
index
].
FullKeypath
);
IShellLinkW_SetPath
(
sl
,
keypath
);
HeapFree
(
GetProcessHeap
(),
0
,
keypath
);
}
...
...
dlls/msi/action.h
View file @
95dea496
...
...
@@ -116,39 +116,3 @@ int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component );
int
get_loaded_feature
(
MSIPACKAGE
*
package
,
LPCWSTR
Feature
);
int
get_loaded_file
(
MSIPACKAGE
*
package
,
LPCWSTR
file
);
int
track_tempfile
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
LPCWSTR
path
);
inline
static
char
*
strdupWtoA
(
const
WCHAR
*
str
)
{
char
*
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
}
return
ret
;
}
inline
static
WCHAR
*
strdupAtoW
(
const
char
*
str
)
{
WCHAR
*
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
inline
static
LPWSTR
dupstrW
(
LPCWSTR
src
)
{
LPWSTR
dest
;
if
(
!
src
)
return
NULL
;
dest
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
dest
,
src
);
return
dest
;
}
dlls/msi/custom.c
View file @
95dea496
...
...
@@ -145,7 +145,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
else
newbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPWSTR
));
newbuf
[
count
]
=
dupstr
W
(
action
);
newbuf
[
count
]
=
strdup
W
(
action
);
package
->
CommitAction
=
newbuf
;
}
else
...
...
@@ -160,7 +160,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
else
newbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPWSTR
));
newbuf
[
count
]
=
dupstr
W
(
action
);
newbuf
[
count
]
=
strdup
W
(
action
);
package
->
DeferredAction
=
newbuf
;
}
...
...
@@ -326,7 +326,7 @@ static void file_running_action(MSIPACKAGE* package, HANDLE Handle,
newbuf
[
count
].
handle
=
Handle
;
newbuf
[
count
].
process
=
process
;
newbuf
[
count
].
name
=
dupstr
W
(
name
);
newbuf
[
count
].
name
=
strdup
W
(
name
);
package
->
RunningAction
=
newbuf
;
}
...
...
@@ -508,8 +508,8 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source,
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
info
)
);
msiobj_addref
(
&
package
->
hdr
);
info
->
package
=
package
;
info
->
target
=
dupstr
W
(
target
);
info
->
source
=
dupstr
W
(
tmp_file
);
info
->
target
=
strdup
W
(
target
);
info
->
source
=
strdup
W
(
tmp_file
);
ThreadHandle
=
CreateThread
(
NULL
,
0
,
DllThread
,(
LPVOID
)
info
,
0
,
&
ThreadId
);
...
...
dlls/msi/dialog.c
View file @
95dea496
...
...
@@ -309,7 +309,7 @@ static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec )
control
->
handler
=
msi_dialog_checkbox_handler
;
prop
=
MSI_RecordGetString
(
rec
,
9
);
if
(
prop
)
control
->
property
=
dupstr
W
(
prop
);
control
->
property
=
strdup
W
(
prop
);
msi_dialog_checkbox_sync_state
(
dialog
,
control
);
return
ERROR_SUCCESS
;
...
...
@@ -364,7 +364,7 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
control
->
handler
=
msi_dialog_edit_handler
;
prop
=
MSI_RecordGetString
(
rec
,
9
);
if
(
prop
)
control
->
property
=
dupstr
W
(
prop
);
control
->
property
=
strdup
W
(
prop
);
val
=
load_dynamic_property
(
dialog
->
package
,
control
->
property
,
NULL
);
SetWindowTextW
(
control
->
hwnd
,
val
);
HeapFree
(
GetProcessHeap
(),
0
,
val
);
...
...
@@ -433,7 +433,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param )
prop
=
MSI_RecordGetString
(
rec
,
1
);
if
(
prop
)
control
->
property
=
dupstr
W
(
prop
);
control
->
property
=
strdup
W
(
prop
);
return
ERROR_SUCCESS
;
}
...
...
@@ -467,7 +467,7 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
}
if
(
prop
)
control
->
property
=
dupstr
W
(
prop
);
control
->
property
=
strdup
W
(
prop
);
/* query the Radio Button table for all control in this group */
r
=
MSI_OpenQuery
(
package
->
db
,
&
view
,
query
,
prop
);
...
...
dlls/msi/format.c
View file @
95dea496
...
...
@@ -114,7 +114,7 @@ static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz)
index
=
get_loaded_file
(
package
,
key
);
if
(
index
>=
0
)
{
value
=
dupstr
W
(
package
->
files
[
index
].
TargetPath
);
value
=
strdup
W
(
package
->
files
[
index
].
TargetPath
);
*
sz
=
(
strlenW
(
value
))
*
sizeof
(
WCHAR
);
}
...
...
dlls/msi/msipriv.h
View file @
95dea496
...
...
@@ -29,6 +29,7 @@
#include "msiquery.h"
#include "objbase.h"
#include "objidl.h"
#include "wine/unicode.h"
#define MSI_DATASIZEMASK 0x00ff
#define MSITYPE_VALID 0x0100
...
...
@@ -386,4 +387,38 @@ extern DWORD gUIFilter;
extern
LPVOID
gUIContext
;
extern
WCHAR
gszLogFile
[
MAX_PATH
];
inline
static
char
*
strdupWtoA
(
LPCWSTR
str
)
{
LPSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
}
return
ret
;
}
inline
static
LPWSTR
strdupAtoW
(
LPCSTR
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
inline
static
LPWSTR
strdupW
(
LPCWSTR
src
)
{
LPWSTR
dest
;
if
(
!
src
)
return
NULL
;
dest
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
dest
,
src
);
return
dest
;
}
#endif
/* __WINE_MSI_PRIVATE__ */
dlls/msi/table.c
View file @
95dea496
...
...
@@ -834,15 +834,6 @@ err:
return
ret
;
}
static
LPWSTR
strdupW
(
LPCWSTR
str
)
{
UINT
len
=
lstrlenW
(
str
)
+
1
;
LPWSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
ret
)
lstrcpyW
(
ret
,
str
);
return
ret
;
}
/* information for default tables */
static
const
WCHAR
szTables
[]
=
{
'_'
,
'T'
,
'a'
,
'b'
,
'l'
,
'e'
,
's'
,
0
};
static
const
WCHAR
szTable
[]
=
{
'T'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
...
...
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