GetResourceSize -> GetResourceSizeA/GetResourceSizeW
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4885 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
822d2fd546
commit
ac156f5ebe
3 changed files with 16 additions and 3 deletions
|
@ -319,7 +319,7 @@ BYTE* CResourceEditor::GetResourceA(char* szType, char* szName, LANGID wLanguage
|
||||||
|
|
||||||
// Returns the size of the requested resource
|
// Returns the size of the requested resource
|
||||||
// Returns -1 if the requested resource can't be found
|
// Returns -1 if the requested resource can't be found
|
||||||
int CResourceEditor::GetResourceSize(WCHAR* szType, WCHAR* szName, LANGID wLanguage) {
|
int CResourceEditor::GetResourceSizeW(WCHAR* szType, WCHAR* szName, LANGID wLanguage) {
|
||||||
CResourceDirectory* nameDir = 0;
|
CResourceDirectory* nameDir = 0;
|
||||||
CResourceDirectory* langDir = 0;
|
CResourceDirectory* langDir = 0;
|
||||||
CResourceDataEntry* data = 0;
|
CResourceDataEntry* data = 0;
|
||||||
|
@ -345,6 +345,18 @@ int CResourceEditor::GetResourceSize(WCHAR* szType, WCHAR* szName, LANGID wLangu
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CResourceEditor::GetResourceSizeA(char* szType, char* szName, LANGID wLanguage) {
|
||||||
|
WCHAR* szwType = ResStringToUnicode(szType);
|
||||||
|
WCHAR* szwName = ResStringToUnicode(szName);
|
||||||
|
|
||||||
|
int result = GetResourceSizeW(szwType, szwName, wLanguage);
|
||||||
|
|
||||||
|
FreeUnicodeResString(szwType);
|
||||||
|
FreeUnicodeResString(szwName);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void CResourceEditor::FreeResource(BYTE* pbResource)
|
void CResourceEditor::FreeResource(BYTE* pbResource)
|
||||||
{
|
{
|
||||||
if (pbResource)
|
if (pbResource)
|
||||||
|
|
|
@ -121,7 +121,8 @@ public:
|
||||||
bool UpdateResourceA(char* szType, WORD szName, LANGID wLanguage, BYTE* lpData, DWORD dwSize);
|
bool UpdateResourceA(char* szType, WORD szName, LANGID wLanguage, BYTE* lpData, DWORD dwSize);
|
||||||
BYTE* GetResourceW(WCHAR* szType, WCHAR* szName, LANGID wLanguage);
|
BYTE* GetResourceW(WCHAR* szType, WCHAR* szName, LANGID wLanguage);
|
||||||
BYTE* GetResourceA(char* szType, char* szName, LANGID wLanguage);
|
BYTE* GetResourceA(char* szType, char* szName, LANGID wLanguage);
|
||||||
int GetResourceSize(WCHAR* szType, WCHAR* szName, LANGID wLanguage);
|
int GetResourceSizeW(WCHAR* szType, WCHAR* szName, LANGID wLanguage);
|
||||||
|
int GetResourceSizeA(char* szType, char* szName, LANGID wLanguage);
|
||||||
void FreeResource(BYTE* pbResource);
|
void FreeResource(BYTE* pbResource);
|
||||||
|
|
||||||
bool AddExtraVirtualSize2PESection(const char* pszSectionName, int addsize);
|
bool AddExtraVirtualSize2PESection(const char* pszSectionName, int addsize);
|
||||||
|
|
|
@ -4708,7 +4708,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
{
|
{
|
||||||
CResourceEditor *dllre = new CResourceEditor(dll, len);
|
CResourceEditor *dllre = new CResourceEditor(dll, len);
|
||||||
LPBYTE ver = dllre->GetResourceA(VS_FILE_INFO, MAKEINTRESOURCE(VS_VERSION_INFO), 0);
|
LPBYTE ver = dllre->GetResourceA(VS_FILE_INFO, MAKEINTRESOURCE(VS_VERSION_INFO), 0);
|
||||||
int versize = dllre->GetResourceASize(VS_FILE_INFO, MAKEINTRESOURCE(VS_VERSION_INFO), 0);
|
int versize = dllre->GetResourceSizeA(VS_FILE_INFO, MAKEINTRESOURCE(VS_VERSION_INFO), 0);
|
||||||
|
|
||||||
if (ver)
|
if (ver)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue