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
e3c1c249
Commit
e3c1c249
authored
Jul 30, 2004
by
Vincent Béron
Committed by
Alexandre Julliard
Jul 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor some of the string processing in msiexec.
parent
6b6abc88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
66 deletions
+28
-66
msiexec.c
programs/msiexec/msiexec.c
+28
-66
No files found.
programs/msiexec/msiexec.c
View file @
e3c1c249
...
...
@@ -85,6 +85,24 @@ static BOOL GetProductCode(LPCSTR str, LPGUID guid)
return
ret
;
}
static
VOID
StringListAppend
(
LPSTR
*
StringList
,
LPCSTR
StringAppend
)
{
LPSTR
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
*
StringList
,
HeapSize
(
GetProcessHeap
(),
0
,
*
StringList
)
+
strlen
(
StringAppend
));
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
*
StringList
=
TempStr
;
strcat
(
*
StringList
,
StringAppend
);
}
static
VOID
StringCompareRemoveLast
(
LPSTR
String
,
CHAR
character
)
{
int
len
=
strlen
(
String
);
if
(
len
&&
String
[
len
-
1
]
==
character
)
String
[
len
-
1
]
=
0
;
}
static
VOID
*
LoadProc
(
LPCSTR
DllName
,
LPCSTR
ProcName
,
HMODULE
*
DllHandle
)
{
VOID
*
(
*
proc
)(
void
);
...
...
@@ -159,7 +177,6 @@ int main(int argc, char *argv[])
LPSTR
PackageName
=
NULL
;
LPGUID
ProductCode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GUID
));
LPSTR
Properties
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);
LPSTR
TempStr
=
NULL
;
DWORD
RepairMode
=
0
;
...
...
@@ -210,14 +227,7 @@ int main(int argc, char *argv[])
ShowUsage
(
1
);
WINE_TRACE
(
"argv[%d] = %s
\n
"
,
i
,
argv
[
i
]);
PackageName
=
argv
[
i
];
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Properties
,
HeapSize
(
GetProcessHeap
(),
0
,
Properties
)
+
strlen
(
ActionAdmin
));
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Properties
=
TempStr
;
strcat
(
Properties
,
ActionAdmin
);
StringListAppend
(
&
Properties
,
ActionAdmin
);
}
else
if
(
!
strncasecmp
(
argv
[
i
],
"/f"
,
2
))
{
...
...
@@ -307,14 +317,7 @@ int main(int argc, char *argv[])
ProductCode
=
NULL
;
PackageName
=
argv
[
i
];
}
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Properties
,
HeapSize
(
GetProcessHeap
(),
0
,
Properties
)
+
strlen
(
RemoveAll
));
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Properties
=
TempStr
;
strcat
(
Properties
,
RemoveAll
);
StringListAppend
(
&
Properties
,
RemoveAll
);
}
else
if
(
!
strncasecmp
(
argv
[
i
],
"/j"
,
2
))
{
...
...
@@ -370,27 +373,13 @@ int main(int argc, char *argv[])
if
(
i
>=
argc
)
ShowUsage
(
1
);
WINE_TRACE
(
"argv[%d] = %s
\n
"
,
i
,
argv
[
i
]);
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Transforms
,
HeapSize
(
GetProcessHeap
(),
0
,
Transforms
)
+
strlen
(
argv
[
i
])
+
1
);
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Transforms
=
TempStr
;
strcat
(
Transforms
,
argv
[
i
]);
strcat
(
Transforms
,
";"
);
StringListAppend
(
&
Transforms
,
argv
[
i
]);
StringListAppend
(
&
Transforms
,
";"
);
}
else
if
(
!
strncasecmp
(
argv
[
i
],
"TRANSFORMS="
,
11
))
{
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Transforms
,
HeapSize
(
GetProcessHeap
(),
0
,
Transforms
)
+
strlen
(
argv
[
i
])
+
1
-
11
);
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Transforms
=
TempStr
;
strcat
(
Transforms
,
argv
[
i
]
+
11
);
strcat
(
Transforms
,
";"
);
StringListAppend
(
&
Transforms
,
argv
[
i
]
+
11
);
StringListAppend
(
&
Transforms
,
";"
);
}
else
if
(
!
strcasecmp
(
argv
[
i
],
"/g"
))
{
...
...
@@ -564,15 +553,8 @@ int main(int argc, char *argv[])
}
else
if
(
strchr
(
argv
[
i
],
'='
))
{
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Properties
,
HeapSize
(
GetProcessHeap
(),
0
,
Properties
)
+
strlen
(
argv
[
i
])
+
1
);
if
(
!
TempStr
)
{
WINE_ERR
(
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Properties
=
TempStr
;
strcat
(
Properties
,
argv
[
i
]);
strcat
(
Properties
,
" "
);
StringListAppend
(
&
Properties
,
argv
[
i
]);
StringListAppend
(
&
Properties
,
" "
);
}
else
{
...
...
@@ -587,28 +569,8 @@ int main(int argc, char *argv[])
}
}
if
(
Properties
[
strlen
(
Properties
)
-
1
]
==
' '
)
{
Properties
[
strlen
(
Properties
)
-
1
]
=
0
;
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Properties
,
HeapSize
(
GetProcessHeap
(),
0
,
Properties
)
-
1
);
if
(
!
TempStr
)
{
fprintf
(
stderr
,
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Properties
=
TempStr
;
}
if
(
Transforms
[
strlen
(
Transforms
)
-
1
]
==
';'
)
{
Transforms
[
strlen
(
Transforms
)
-
1
]
=
0
;
TempStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
Transforms
,
HeapSize
(
GetProcessHeap
(),
0
,
Transforms
)
-
1
);
if
(
!
TempStr
)
{
fprintf
(
stderr
,
"Out of memory!
\n
"
);
ExitProcess
(
1
);
}
Transforms
=
TempStr
;
}
StringCompareRemoveLast
(
Properties
,
' '
);
StringCompareRemoveLast
(
Transforms
,
';'
);
if
(
FunctionInstallAdmin
&&
FunctionPatch
)
FunctionInstall
=
FALSE
;
...
...
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