From 9a6e21556f190af4e0dffbe47ce777534b20919c Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 8 Aug 2002 15:05:16 +0000 Subject: [PATCH] no need git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@667 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/dllpaths.c | 91 --------------------------------------- Source/exehead/dllpaths.h | 13 ------ 2 files changed, 104 deletions(-) delete mode 100644 Source/exehead/dllpaths.c delete mode 100644 Source/exehead/dllpaths.h diff --git a/Source/exehead/dllpaths.c b/Source/exehead/dllpaths.c deleted file mode 100644 index 6fd66300..00000000 --- a/Source/exehead/dllpaths.c +++ /dev/null @@ -1,91 +0,0 @@ - - -#include "dllpaths.h" -#include -#include "util.h" - - -static int initialised = 0; -static int numPackedPathIds; -static int* packedPathIds; -static char** newPaths; - - -void* DllPathsAlloc(long bytes) -{ - return HeapAlloc( - GetProcessHeap(), - HEAP_ZERO_MEMORY, - bytes); -} - -void DllPathsFree(void* ptr) -{ - HeapFree(GetProcessHeap(),0,ptr); -} - -void DllPathsCleanup(void) -{ - if (initialised) - { - if (packedPathIds) - { - int i; - DllPathsFree(packedPathIds); - for (i = 0; i < numPackedPathIds; i++) - { - DeleteFile(newPaths[i]); - DllPathsFree(newPaths[i]); - } - DllPathsFree(newPaths); - } - - numPackedPathIds = 0; - packedPathIds = 0; - newPaths = 0; - initialised = 0; - } -} - -void DllPathsInitialise(void) -{ - if (!initialised) - { - numPackedPathIds = 0; - packedPathIds = 0; - newPaths = 0; - initialised = 1; - } -} - -void DllPathsAdd(int n,char* path) -{ - DllPathsInitialise(); - if (!DllPathsDetermined(n)) - { - int* newIntArray = (int*)DllPathsAlloc(sizeof(int)*(numPackedPathIds+1)); - char** newCharArray = (char**)DllPathsAlloc(sizeof(char*)*(numPackedPathIds+1)); - mini_memcpy(newIntArray,packedPathIds,numPackedPathIds*sizeof(int)); - mini_memcpy(newCharArray,newPaths,numPackedPathIds*sizeof(char*)); - DllPathsFree(packedPathIds); - DllPathsFree(newPaths); - packedPathIds = newIntArray; - newPaths = newCharArray; - packedPathIds[numPackedPathIds] = n; - newPaths[numPackedPathIds] = (char*)DllPathsAlloc(sizeof(char)*(lstrlen(path)+1)); - lstrcpy(newPaths[numPackedPathIds],path); - numPackedPathIds++; - } -} - -char* DllPathsDetermined(int n) -{ - int i; - DllPathsInitialise(); - for (i = 0; i < numPackedPathIds; i++) - { - if (packedPathIds[i] == n) - return newPaths[i]; - } - return 0; -} diff --git a/Source/exehead/dllpaths.h b/Source/exehead/dllpaths.h deleted file mode 100644 index 4ef449fd..00000000 --- a/Source/exehead/dllpaths.h +++ /dev/null @@ -1,13 +0,0 @@ - - -#ifndef __X18_DLLPATHS_H -#define __X18_DLLPATHS_H - - -void DllPathsCleanup(void); -void DllPathsInitialise(void); -void DllPathsAdd(int,char*); -char* DllPathsDetermined(int); - - -#endif \ No newline at end of file