< prev index next >
src/jdk.jpackage/windows/native/msiwrapper/Resources.cpp
Print this page
@@ -59,11 +59,12 @@
}
instance = module;
}
std::string Resource::getErrMsg(const std::string &descr) const {
- return (tstrings::any() << descr << " (name='" << nameStr << "', type='" << typeStr << "')").str();
+ return (tstrings::any() << descr << " (name='" << nameStr <<
+ "', type='" << typeStr << "')").str();
}
HRSRC Resource::findResource() const {
LPCTSTR id = namePtr;
// string resources are stored in blocks (stringtables)
@@ -74,11 +75,12 @@
return FindResource(instance, id, typePtr);
}
LPVOID Resource::getPtr(DWORD &size) const
{
- // LoadString returns the same result if value is zero-length or if if the value does not exists,
+ // LoadString returns the same result if value is zero-length or
+ // if if the value does not exists,
// so wee need to ensure the stringtable exists
HRSRC resInfo = findResource();
if (resInfo == NULL) {
JP_THROW(SysError(getErrMsg("cannot find resource"), FindResource));
}
@@ -92,13 +94,16 @@
if (res == NULL) {
JP_THROW(SysError(getErrMsg("cannot lock resource"), LockResource));
}
if (typePtr == RT_STRING) {
- // string resources are stored in stringtables and need special handling
- // The simplest way (while we don't need handle resource locale) is LoadString
- // But this adds dependency on user32.dll, so implement custom string extraction
+ // string resources are stored in stringtables and
+ // need special handling
+ // The simplest way (while we don't need handle resource locale)
+ // is LoadString
+ // But this adds dependency on user32.dll,
+ // so implement custom string extraction
// number in the block (namePtr is an integer)
size_t num = size_t(namePtr) & 0xf;
LPWSTR strPtr = (LPWSTR)ptr;
for (size_t i = 0; i < num; i++) {
< prev index next >