aboutsummaryrefslogtreecommitdiff
path: root/sfmain.c
diff options
context:
space:
mode:
authorEduardo Casino <mail@eduardocasino.es>2022-05-16 20:12:19 +0200
committerJavier <dev.git@javispedro.com>2022-05-23 00:01:55 +0200
commit7b243074da3f4be6ed47426925f203c547c1c729 (patch)
treee200ebfbf6d3912458db78d26da4fb152bc1c4bb /sfmain.c
parentb8eb74ac1d31ffc382e654e19bba4e5e48f0001e (diff)
downloadvbados-7b243074da3f4be6ed47426925f203c547c1c729.tar.gz
vbados-7b243074da3f4be6ed47426925f203c547c1c729.zip
Add support for windows host short file names
Diffstat (limited to 'sfmain.c')
-rw-r--r--sfmain.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sfmain.c b/sfmain.c
index 9432508..3cbd336 100644
--- a/sfmain.c
+++ b/sfmain.c
@@ -452,7 +452,7 @@ error:
}
-static int configure_driver(LPTSRDATA data)
+static int configure_driver(LPTSRDATA data, bool short_fnames)
{
unsigned i;
int32_t err;
@@ -481,6 +481,16 @@ static int configure_driver(LPTSRDATA data)
data->tz_offset = 0;
}
+ // Get uppercase and valid file char tables
+ err = get_nls(&data->file_upper_case, &data->file_char);
+ if (err) {
+ puts("Cannot get the NLS tables.");
+ return -1;
+ }
+
+ // Set use of short file names from Windows hosts
+ data->short_fnames = short_fnames;
+
// Now try to initialize VirtualBox communication
err = vbox_init_device(&data->vb);
if (err) {
@@ -512,12 +522,6 @@ static int configure_driver(LPTSRDATA data)
return -1;
}
- err = get_nls(&data->file_upper_case, &data->file_char);
- if (err) {
- puts("Cannot get the NLS tables.");
- return -1;
- }
-
load_unicode_table( &data->unicode_table);
printf("Connected to VirtualBox shared folder service\n");
@@ -617,6 +621,7 @@ static void print_help(void)
"Supported actions:\n"
" install install the driver (default)\n"
" low install in conventional memory (otherwise UMB)\n"
+ " short use short file names from windows hosts\n"
" uninstall uninstall the driver from memory\n"
" list list available shared folders\n"
" mount <FOLD> <X:> mount a shared folder into drive X:\n"
@@ -668,6 +673,7 @@ int main(int argc, const char *argv[])
if (argi >= argc || stricmp(argv[argi], "install") == 0) {
bool high = true;
+ bool short_fnames = false;
argi++;
for (; argi < argc; argi++) {
@@ -675,6 +681,8 @@ int main(int argc, const char *argv[])
high = false;
} else if (stricmp(argv[argi], "high") == 0) {
high = true;
+ } else if (stricmp(argv[argi], "short") == 0) {
+ short_fnames = true;
} else {
return invalid_arg(argv[argi]);
}
@@ -695,7 +703,7 @@ int main(int argc, const char *argv[])
} else {
deallocate_environment(_psp);
}
- err = configure_driver(data);
+ err = configure_driver(data, short_fnames);
if (err) {
if (high) cancel_reallocation(FP_SEG(data));
return EXIT_FAILURE;