https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4c930799f1e4e072c7b2d…
commit 4c930799f1e4e072c7b2d0a5bffe9ab977a03d95
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Mon Feb 22 14:17:32 2021 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Mon Feb 22 14:21:43 2021 +0100
[RSYM/x64] Make command line compatible with x86 version
x86 version needs input and output file names as arguments, even if is called with
input file name = output file name.
x86 version also accepts a -s argument to the root path of ReactOS sources
Make x64 version take the same arguments.
---
sdk/tools/rsym/rsym64.c | 42 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 37 insertions(+), 5 deletions(-)
diff --git a/sdk/tools/rsym/rsym64.c b/sdk/tools/rsym/rsym64.c
index 746e5e4cfd0..8c3b0b3e85f 100644
--- a/sdk/tools/rsym/rsym64.c
+++ b/sdk/tools/rsym/rsym64.c
@@ -865,15 +865,47 @@ int main(int argc, char* argv[])
FILE_INFO File;
FILE* outfile;
int ret;
+ int arg, argstate = 0;
+ char *SourcePath = NULL;
- if (argc != 3)
+ for (arg = 1; arg < argc; arg++)
{
- fprintf(stderr, "Usage: rsym <exefile> <symfile>\n");
- exit(1);
+ switch (argstate)
+ {
+ default:
+ argstate = -1;
+ break;
+
+ case 0:
+ if (!strcmp(argv[arg], "-s"))
+ {
+ argstate = 1;
+ }
+ else
+ {
+ argstate = 2;
+ pszInFile = convert_path(argv[arg]);
+ }
+ break;
+
+ case 1:
+ free(SourcePath);
+ SourcePath = strdup(argv[arg]);
+ argstate = 0;
+ break;
+
+ case 2:
+ pszOutFile = convert_path(argv[arg]);
+ argstate = 3;
+ break;
+ }
}
- pszInFile = convert_path(argv[1]);
- pszOutFile = convert_path(argv[2]);
+ if (argstate != 3)
+ {
+ fprintf(stderr, "Usage: rsym [-s <sources>] <input>
<output>\n");
+ exit(1);
+ }
File.FilePtr = load_file(pszInFile, &File.cbInFileSize);
if (!File.FilePtr)