Adding Unicode support to System plugin
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6050 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9852de80be
commit
57d296e159
5 changed files with 1348 additions and 1252 deletions
|
@ -1,3 +1,5 @@
|
|||
// Unicode support by Jim Park -- 08/23/2007
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Plugin.h"
|
||||
#include "System.h"
|
||||
|
@ -23,6 +25,18 @@ PLUGINFUNCTIONSHORT(Alloc)
|
|||
}
|
||||
PLUGINFUNCTIONEND
|
||||
|
||||
PLUGINFUNCTIONSHORT(StrAlloc)
|
||||
{
|
||||
int size;
|
||||
if ((size = popint64()) == 0)
|
||||
{
|
||||
system_pushint(0);
|
||||
return;
|
||||
}
|
||||
system_pushint((int) GlobalAlloc(GPTR, size * sizeof(TCHAR)));
|
||||
}
|
||||
PLUGINFUNCTIONEND
|
||||
|
||||
PLUGINFUNCTIONSHORT(Copy)
|
||||
{
|
||||
int size = 0;
|
||||
|
|
|
@ -14,7 +14,7 @@ TCHAR *AllocString()
|
|||
|
||||
TCHAR *AllocStr(TCHAR *str)
|
||||
{
|
||||
return lstrcpy(AllocString(), str);
|
||||
return lstrcpyn(AllocString(), str, g_stringsize);
|
||||
}
|
||||
|
||||
TCHAR* system_popstring()
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -47,6 +47,11 @@
|
|||
#define PAT_WSTRING 4
|
||||
#define PAT_GUID 5
|
||||
#define PAT_CALLBACK 6
|
||||
#ifdef _UNICODE
|
||||
#define PAT_TSTRING PAT_WSTRING
|
||||
#else
|
||||
#define PAT_TSTRING PAT_STRING
|
||||
#endif
|
||||
|
||||
// Input/Output Source/Destination
|
||||
#define IOT_NONE 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue