< prev index next >
src/jdk.incubator.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 402,416 ****
if (value == NULL) {
return result;
}
! mbstowcs_s(&count, NULL, 0, value, _TRUNCATE);
if (count > 0) {
! result.data = new wchar_t[count + 1];
! mbstowcs_s(&result.length, result.data, count, value, count);
}
return result;
}
--- 402,422 ----
if (value == NULL) {
return result;
}
! count = MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
! value, -1, NULL, 0);
if (count > 0) {
! result.data = new wchar_t[count];
! result.length = MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
! value, -1, result.data, (int)count);
! if (result.length == 0) {
! delete[] result.data;
! result.data = NULL;
! }
}
return result;
}
< prev index next >