implemented GetDLLVersionLocal for non Win32 platforms
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3653 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
7e893b2a80
commit
38d7adce15
4 changed files with 104 additions and 9 deletions
|
@ -188,8 +188,8 @@ bool CResourceEditor::UpdateResource(WORD szType, WORD szName, LANGID wLanguage,
|
|||
return UpdateResource(MAKEINTRESOURCE(szType), MAKEINTRESOURCE(szName), wLanguage, lpData, dwSize);
|
||||
}
|
||||
|
||||
// Returns a copy of the resource requested
|
||||
// Returns 0 if resource can't be found
|
||||
// Returns a copy of the requested resource
|
||||
// Returns 0 if the requested resource can't be found
|
||||
BYTE* CResourceEditor::GetResource(char* szType, char* szName, LANGID wLanguage) {
|
||||
CResourceDirectory* nameDir = 0;
|
||||
CResourceDirectory* langDir = 0;
|
||||
|
@ -219,6 +219,34 @@ BYTE* CResourceEditor::GetResource(char* szType, char* szName, LANGID wLanguage)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// Returns the size of the requested resource
|
||||
// Returns -1 if the requested resource can't be found
|
||||
int CResourceEditor::GetResourceSize(char* szType, char* szName, LANGID wLanguage) {
|
||||
CResourceDirectory* nameDir = 0;
|
||||
CResourceDirectory* langDir = 0;
|
||||
CResourceDataEntry* data = 0;
|
||||
|
||||
int i = m_cResDir->Find(szType);
|
||||
if (i > -1) {
|
||||
nameDir = m_cResDir->GetEntry(i)->GetSubDirectory();
|
||||
i = nameDir->Find(szName);
|
||||
if (i > -1) {
|
||||
langDir = nameDir->GetEntry(i)->GetSubDirectory();
|
||||
i = 0;
|
||||
if (wLanguage)
|
||||
i = langDir->Find(wLanguage);
|
||||
if (i > -1) {
|
||||
data = langDir->GetEntry(i)->GetDataEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data)
|
||||
return (int) data->GetSize();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CResourceEditor::FreeResource(BYTE* pbResource)
|
||||
{
|
||||
if (pbResource)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue