diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Additions/os2 | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Additions/os2')
-rw-r--r-- | src/VBox/Additions/os2/Config.kmk | 18 | ||||
-rw-r--r-- | src/VBox/Additions/os2/Makefile.kmk | 13 | ||||
-rw-r--r-- | src/VBox/Additions/os2/VBoxReplaceDll.cpp | 104 |
3 files changed, 128 insertions, 7 deletions
diff --git a/src/VBox/Additions/os2/Config.kmk b/src/VBox/Additions/os2/Config.kmk index f1f56cce..2dfe650b 100644 --- a/src/VBox/Additions/os2/Config.kmk +++ b/src/VBox/Additions/os2/Config.kmk @@ -4,7 +4,7 @@ # # -# Copyright (C) 2006-2007 Oracle Corporation +# Copyright (C) 2006-2010 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -26,16 +26,22 @@ ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED endif ## FIXME -PATH_DDKVIDEO = D:/dev/ddk/200402/video -PATH_DDKBASE = D:/dev/ddk/200402/base +PATH_DDKVIDEO ?= D:/ddk/200402/video +PATH_DDKBASE ?= D:/ddk/200402/base +TOOL_MASM510_AS ?= $(PATH_DDKBASE)/tools/masm.exe +TOOL_MSLINK510_LD ?= $(PATH_DDKBASE)/tools/link.exe +PATH_TOOL_VAC308 ?= D:/VACpp/v3.08 +PATH_TOOL_ALP ?= D:/Toolkit/v4.52/bin # # Template for VAC308 Gradd stuff. # TEMPLATE_VBOXOS2VAC308 = Template for VisualAge for C++ v3.08 / Gradd -TEMPLATE_VBOXOS2VAC308_TOOL = VAC308 -TEMPLATE_VBOXOS2VAC308_ASTOOL = ALP -TEMPLATE_VBOXOS2VAC308_DEFS += IN_RING3 RT_OS_OS2 +TEMPLATE_VBOXOS2VAC308_TOOL = VAC308 +TEMPLATE_VBOXOS2VAC308_ASTOOL = ALP +TEMPLATE_VBOXOS2VAC308_ARTOOL = GCC3OMF +TEMPLATE_VBOXOS2VAC308_INST = $(INST_ADDITIONS) +TEMPLATE_VBOXOS2VAC308_DEFS = RT_OS_OS2 IN_RING3 ## @todo IN_GUEST IN_GUEST_R3 IN_RT_R3 TEMPLATE_VBOXOS2VAC308_CFLAGS += /Gn+ # Do not generate default libraries in object. TEMPLATE_VBOXOS2VAC308_CFLAGS += /Gr+ # Allow object code to run at ring 0. diff --git a/src/VBox/Additions/os2/Makefile.kmk b/src/VBox/Additions/os2/Makefile.kmk index e0914c46..d02a2f91 100644 --- a/src/VBox/Additions/os2/Makefile.kmk +++ b/src/VBox/Additions/os2/Makefile.kmk @@ -27,11 +27,22 @@ endif # The sub-makefiles. # ifndef VBOX_OSE -# include $(PATH_SUB_CURRENT)/VBoxGradd/Makefile.kmk + include $(PATH_SUB_CURRENT)/VBoxGradd/Makefile.kmk # include $(PATH_SUB_CURRENT)/VBoxGrext/Makefile.kmk + include $(PATH_SUB_CURRENT)/VBoxMouse/Makefile.kmk include $(PATH_SUB_CURRENT)/Bin/Makefile.kmk endif #include $(PATH_SUB_CURRENT)/VBoxSF/Makefile.kmk + +# +# Installation helper. +# +PROGRAMS += VBoxReplaceDll +VBoxReplaceDll_TEMPLATE = NewVBoxGuestR3Exe +VBoxReplaceDll_SOURCES = VBoxReplaceDll.cpp + + + include $(FILE_KBUILD_SUB_FOOTER) diff --git a/src/VBox/Additions/os2/VBoxReplaceDll.cpp b/src/VBox/Additions/os2/VBoxReplaceDll.cpp new file mode 100644 index 00000000..cb07bd83 --- /dev/null +++ b/src/VBox/Additions/os2/VBoxReplaceDll.cpp @@ -0,0 +1,104 @@ +/** $Id: VBoxReplaceDll.cpp $ */ +/** @file + * VBoxReplaceDll - helper for replacing a dll when it's in use by the system + */ + +/* + * Copyright (C) 2013 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + + +/******************************************************************************* +* Header Files * +*******************************************************************************/ +#define INCL_BASE +#include <os2.h> +#include <stdio.h> +#include <string.h> + + +static int usage(const char *argv0) +{ + char *psz1 = strrchr(argv0, '\\'); + if (psz1) + argv0 = psz1 + 1; + psz1 = strrchr(argv0, '/'); + if (psz1) + argv0 = psz1 + 1; + psz1 = strrchr(argv0, ':'); + if (psz1) + argv0 = psz1 + 1; + + printf("Usage: %s <dll1> [dll2 ...[dllN]]\n" + "\n" + "Tells the kernel to cache the specified DLLs in memory and close the\n" + "files on disk, allowing new DLL versions to be installed.\n" + "\n" + "Copyright (C) 2013 Oracle Corporation\n", + argv0); + return 0; +} + +int main(int argc, char **argv) +{ + int fOptions = 1; + int cProcessed = 0; + int i; + for (i = 1; i < argc; i++) + { + if ( fOptions + && argv[i][0] == '-') + { + if (!strcmp(argv[i], "--")) + fOptions = 0; + else if ( !strcmp(argv[i], "--help") + || !strcmp(argv[i], "-help") + || !strcmp(argv[i], "-h") + || !strcmp(argv[i], "-?") ) + return usage(argv[0]); + else if ( !strcmp(argv[i], "--version") + || !strcmp(argv[i], "-V") ) + { + printf("$Revision: 89639 $\n"); + return 0; + } + else + { + fprintf(stderr, "syntax error: Invalid option '%s'!\n", argv[i]); + return 2; + } + } + else + { + /* + * Replace the specified DLL. + */ + APIRET rc = DosReplaceModule((PCSZ)argv[i], NULL, NULL); + if (rc == NO_ERROR) + printf("info: Successfully cached '%s'.\n", argv[i]); + else + { + fprintf(stderr, "error: DosReplaceModule failed with rc=%u on '%s'.\n", rc, argv[i]); + return 1; + } + cProcessed++; + } + } + + if (cProcessed == 0) + { + fprintf(stderr, "syntax error: No DLLs specified. (Consult --help for usage.)\n"); + return 1; + } + + return 0; +} + |