Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5f83069b
Commit
5f83069b
authored
Sep 08, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Split code to create a random package name into a separate function.
parent
00fdc6cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
30 deletions
+33
-30
action.c
dlls/msi/action.c
+33
-30
No files found.
dlls/msi/action.c
View file @
5f83069b
...
...
@@ -3487,32 +3487,25 @@ end:
return
rc
;
}
static
UINT
msi_
make_package_local
(
MSIPACKAGE
*
package
,
HKEY
hkey
)
static
UINT
msi_
get_local_package_name
(
LPWSTR
path
)
{
static
const
WCHAR
installerPathFmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'%'
,
'x'
,
'.'
,
'm'
,
's'
,
'i'
,
0
};
static
const
WCHAR
szOriginalDatabase
[]
=
{
'O'
,
'r'
,
'i'
,
'g'
,
'i'
,
'n'
,
'a'
,
'l'
,
'D'
,
'a'
,
't'
,
'a'
,
'b'
,
'a'
,
's'
,
'e'
,
0
};
WCHAR
windir
[
MAX_PATH
],
path
[
MAX_PATH
],
packagefile
[
MAX_PATH
];
INT
num
,
start
;
LPWSTR
msiFilePath
;
BOOL
r
;
/* copy the package locally */
num
=
GetTickCount
()
&
0xffff
;
if
(
!
num
)
num
=
1
;
start
=
num
;
GetWindowsDirectoryW
(
windir
,
MAX_PATH
);
snprintfW
(
packagefile
,
MAX_PATH
,
fmt
,
windir
,
num
);
do
static
const
WCHAR
szInstaller
[]
=
{
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
'x'
,
'.'
,
'm'
,
's'
,
'i'
,
0
};
DWORD
time
,
len
,
i
;
HANDLE
handle
;
time
=
GetTickCount
();
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
lstrcatW
(
path
,
szInstaller
);
CreateDirectoryW
(
path
,
NULL
);
len
=
lstrlenW
(
path
);
for
(
i
=
0
;
i
<
0x10000
;
i
++
)
{
HANDLE
handle
=
CreateFileW
(
packagefile
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
0
);
snprintfW
(
&
path
[
len
],
MAX_PATH
-
len
,
fmt
,
(
time
+
i
)
&
0xffff
);
handle
=
CreateFileW
(
path
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
handle
);
...
...
@@ -3520,13 +3513,23 @@ static UINT msi_make_package_local( MSIPACKAGE *package, HKEY hkey )
}
if
(
GetLastError
()
!=
ERROR_FILE_EXISTS
&&
GetLastError
()
!=
ERROR_SHARING_VIOLATION
)
break
;
if
(
!
(
++
num
&
0xffff
))
num
=
1
;
sprintfW
(
packagefile
,
fmt
,
num
);
}
while
(
num
!=
start
);
return
ERROR_FUNCTION_FAILED
;
}
snprintfW
(
path
,
MAX_PATH
,
installerPathFmt
,
windir
);
create_full_pathW
(
path
);
return
ERROR_SUCCESS
;
}
static
UINT
msi_make_package_local
(
MSIPACKAGE
*
package
,
HKEY
hkey
)
{
static
const
WCHAR
szOriginalDatabase
[]
=
{
'O'
,
'r'
,
'i'
,
'g'
,
'i'
,
'n'
,
'a'
,
'l'
,
'D'
,
'a'
,
't'
,
'a'
,
'b'
,
'a'
,
's'
,
'e'
,
0
};
WCHAR
packagefile
[
MAX_PATH
];
LPWSTR
msiFilePath
;
UINT
r
;
r
=
msi_get_local_package_name
(
packagefile
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
TRACE
(
"Copying to local package %s
\n
"
,
debugstr_w
(
packagefile
));
...
...
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