summaryrefslogtreecommitdiff
path: root/setup/devcon/devcon.cpp
diff options
context:
space:
mode:
authorWei Mao <[email protected]>2017-03-21 06:44:26 -0700
committerWei Mao <[email protected]>2017-03-21 06:49:43 -0700
commit0fcda712a220abea5dc7a6e60c4f406ca14d34dc (patch)
treeef033bf9d5b601b72976d0300dbd7041ad36ae78 /setup/devcon/devcon.cpp
parentde981510f34192ff725f68130f99a99e5fa0e200 (diff)
Add cmdline option -u for Unicode (UTF-16) output
Diffstat (limited to 'setup/devcon/devcon.cpp')
-rw-r--r--setup/devcon/devcon.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/setup/devcon/devcon.cpp b/setup/devcon/devcon.cpp
index 08736c82..1328b91c 100644
--- a/setup/devcon/devcon.cpp
+++ b/setup/devcon/devcon.cpp
@@ -14,8 +14,6 @@ Abstract:
--*/
#include "devcon.h"
-#include <io.h>
-#include <fcntl.h>
struct IdEntry {
LPCTSTR String; // string looking for
@@ -1077,13 +1075,9 @@ Return Value:
// -m:<machine> - remote
// -r - auto reboot
// -f - force operation
+ // -u - unicode output
//
-#ifdef UNICODE
- _setmode(_fileno(stdout), _O_WTEXT);
- _setmode(_fileno(stderr), _O_WTEXT);
-#endif
-
baseName = _tcsrchr(argv[0],TEXT('\\'));
if(!baseName) {
baseName = argv[0];
@@ -1117,6 +1111,18 @@ Return Value:
} else {
flags |= DEVCON_FLAG_FORCE;
}
+ } else if((argv[firstArg][1]==TEXT('u')) || (argv[firstArg][1]==TEXT('U'))) {
+ if((argv[firstArg][2]!=TEXT('\0')) ) {
+ //
+ // don't recognize this switch
+ //
+ break;
+ } else {
+#ifdef UNICODE
+ _setmode(_fileno(stdout), _O_WTEXT);
+ _setmode(_fileno(stderr), _O_WTEXT);
+#endif
+ }
} else {
//
// don't recognize this switch