my_alloc
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@844 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
22a71cf015
commit
8c7c3c304e
2 changed files with 6 additions and 1 deletions
|
@ -39,6 +39,10 @@ int NSISCALL my_MessageBox(const char *text, UINT type) {
|
||||||
return MessageBox(g_hwnd, text, g_caption, type);
|
return MessageBox(g_hwnd, text, g_caption, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void * NSISCALL my_alloc(DWORD dwBytes) {
|
||||||
|
return (void *)GlobalAlloc(GPTR, dwBytes);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef NSIS_SUPPORT_RMDIR
|
#ifdef NSIS_SUPPORT_RMDIR
|
||||||
void NSISCALL doRMDir(char *buf, int recurse)
|
void NSISCALL doRMDir(char *buf, int recurse)
|
||||||
{
|
{
|
||||||
|
@ -251,7 +255,7 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
||||||
int l=pszWinInit + dwFileSize-pszFirstRenameLine;
|
int l=pszWinInit + dwFileSize-pszFirstRenameLine;
|
||||||
if (!findinmem(pszFirstRenameLine,szRenameLine,l))
|
if (!findinmem(pszFirstRenameLine,szRenameLine,l))
|
||||||
{
|
{
|
||||||
void* data=(void*)GlobalAlloc(GMEM_FIXED,l);
|
void* data=(void*)my_alloc(l);
|
||||||
mini_memcpy(data, pszFirstRenameLine, l);
|
mini_memcpy(data, pszFirstRenameLine, l);
|
||||||
mini_memcpy(pszFirstRenameLine + cchRenameLine, data, l);
|
mini_memcpy(pszFirstRenameLine + cchRenameLine, data, l);
|
||||||
GlobalFree((HGLOBAL)data);
|
GlobalFree((HGLOBAL)data);
|
||||||
|
|
|
@ -39,6 +39,7 @@ extern char g_log_file[1024];
|
||||||
|
|
||||||
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir);
|
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir);
|
||||||
int NSISCALL my_MessageBox(const char *text, UINT type);
|
int NSISCALL my_MessageBox(const char *text, UINT type);
|
||||||
|
void * NSISCALL my_alloc(DWORD dwBytes);
|
||||||
|
|
||||||
void NSISCALL doRMDir(char *buf, int recurse);
|
void NSISCALL doRMDir(char *buf, int recurse);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue