From: ShadowFlare Date: Tue, 15 Jul 2008 01:12:14 +0000 (-0600) Subject: Added license info and cleaned up code and repository X-Git-Url: https://sfsrealm.hopto.org/projects/?a=commitdiff_plain;h=f15b049dbe98d0083932932f2b70015ea2deb84a;p=grpapi.git Added license info and cleaned up code and repository --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..191a540 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*/*Debug/ +*/*Release/ +*.ncb +*.suo +*.user diff --git a/drawgrp/drawgrp.cpp b/drawgrp/drawgrp.cpp index 269e45c..6dbb7eb 100644 --- a/drawgrp/drawgrp.cpp +++ b/drawgrp/drawgrp.cpp @@ -1,5 +1,6 @@ // drawgrp.cpp : Defines the entry point for the console application. // +/* License information for this code is in license.txt */ #define _CRT_RAND_S #include diff --git a/drawgrp/drawgrp.vcproj b/drawgrp/drawgrp.vcproj index a8188a5..a5b64e7 100644 --- a/drawgrp/drawgrp.vcproj +++ b/drawgrp/drawgrp.vcproj @@ -5,9 +5,6 @@ Name="drawgrp" ProjectGUID="{10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}" RootNamespace="drawgrp" - SccProjectName=""$/grpapi_VS2005.root/grpapi", IGAAAAAA" - SccLocalPath=".." - SccProvider="MSSCCI:Microsoft Visual SourceSafe" > diff --git a/grpapi/grpapi.def b/grpapi/grpapi.def index 2d95f21..f879de0 100644 --- a/grpapi/grpapi.def +++ b/grpapi/grpapi.def @@ -1,3 +1,5 @@ +; License information for this code is in license.txt + EXPORTS LoadPalette @1 LoadGrp @2 diff --git a/grpapi/grpapi.h b/grpapi/grpapi.h index bd5f6cb..f3f746a 100644 --- a/grpapi/grpapi.h +++ b/grpapi/grpapi.h @@ -1,6 +1,7 @@ /* - ShadowFlare GRP Library. (c) ShadowFlare Software 2002-2006 + ShadowFlare GRP Library. (c) ShadowFlare Software 2002-2008 + License information for this code is in license.txt Any comments or suggestions are accepted at blakflare@hotmail.com (ShadowFlare) */ diff --git a/grpapi/grpapi.rc b/grpapi/grpapi.rc index e330c45..b80cf7e 100644 --- a/grpapi/grpapi.rc +++ b/grpapi/grpapi.rc @@ -1,3 +1,5 @@ +// License information for this code is in license.txt + // Microsoft Visual C++ generated resource script. // #include "resource.h" diff --git a/grpapi/grpapi.sln b/grpapi/grpapi.sln index f2413bb..4a887c1 100644 --- a/grpapi/grpapi.sln +++ b/grpapi/grpapi.sln @@ -1,32 +1,24 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drawgrp", "..\drawgrp\drawgrp.vcproj", "{10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpapi", "grpapi.vcproj", "{08812E9C-7F03-4DCB-8828-F3BDB0728EC7}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grplib", "grplib.vcproj", "{66127C6F-39DA-4B7A-9856-789ED0139DCB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 4 - SccProjectName0 = \u0022$/grpapi_VS2005.root/grpapi\u0022,\u0020IGAAAAAA - SccLocalPath0 = .. - SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe - CanCheckoutShared = false - SccProjectFilePathRelativizedFromConnection0 = grpapi\\ - SccProjectUniqueName1 = ..\\drawgrp\\drawgrp.vcproj - SccLocalPath1 = .. - CanCheckoutShared = false - SccProjectFilePathRelativizedFromConnection1 = drawgrp\\ - SccProjectUniqueName2 = grpapi.vcproj - SccLocalPath2 = .. - CanCheckoutShared = false - SccProjectFilePathRelativizedFromConnection2 = grpapi\\ - SccProjectUniqueName3 = grplib.vcproj - SccLocalPath3 = .. - CanCheckoutShared = false - SccProjectFilePathRelativizedFromConnection3 = grpapi\\ - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 diff --git a/grpapi/grpapi.vcproj b/grpapi/grpapi.vcproj index 5761f2b..063f310 100644 --- a/grpapi/grpapi.vcproj +++ b/grpapi/grpapi.vcproj @@ -5,9 +5,6 @@ Name="grpapi" ProjectGUID="{08812E9C-7F03-4DCB-8828-F3BDB0728EC7}" RootNamespace="grpapi" - SccProjectName=""$/grpapi_VS2005.root/grpapi", IGAAAAAA" - SccLocalPath=".." - SccProvider="MSSCCI:Microsoft Visual SourceSafe" > +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. \ No newline at end of file diff --git a/loadstorm/Storm.cpp b/loadstorm/Storm.cpp index 02b528f..4d73c82 100644 --- a/loadstorm/Storm.cpp +++ b/loadstorm/Storm.cpp @@ -1,6 +1,7 @@ /* Storm.cpp */ +/* License information for this code is in license.txt */ #include "storm.h" @@ -9,27 +10,28 @@ struct STORMMODULE { ~STORMMODULE(); } Storm; +void LoadStormFunctions(); void FreeStorm(); HINSTANCE hStorm = 0; BOOL AlreadyLoaded = FALSE; // Storm Function Names -funcSFileCloseArchive SFileCloseArchive = 0; -funcSFileCloseFile SFileCloseFile = 0; -funcSFileDestroy SFileDestroy = 0; -funcSFileGetFileArchive SFileGetFileArchive = 0; -funcSFileGetFileSize SFileGetFileSize = 0; -funcSFileOpenArchive SFileOpenArchive = 0; -funcSFileOpenFile SFileOpenFile = 0; -funcSFileOpenFileEx SFileOpenFileEx = 0; -funcSFileReadFile SFileReadFile = 0; -funcSFileSetBasePath SFileSetBasePath = 0; -funcSFileSetFilePointer SFileSetFilePointer = 0; -funcSFileSetLocale SFileSetLocale = 0; -funcSFileGetBasePath SFileGetBasePath = 0; -funcSFileGetArchiveName SFileGetArchiveName = 0; -funcSFileGetFileName SFileGetFileName = 0; +BOOL (WINAPI* SFileOpenArchive)(LPCSTR lpFilename, DWORD dwPriority, DWORD dwFlags, MPQHANDLE *hMPQ) = 0; +BOOL (WINAPI* SFileCloseArchive)(MPQHANDLE hMPQ) = 0; +BOOL (WINAPI* SFileOpenFile)(LPCSTR lpFileName, MPQHANDLE *hFile) = 0; +BOOL (WINAPI* SFileOpenFileEx)(MPQHANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, MPQHANDLE *hFile) = 0; +BOOL (WINAPI* SFileCloseFile)(MPQHANDLE hFile) = 0; +DWORD (WINAPI* SFileGetFileSize)(MPQHANDLE hFile, LPDWORD lpFileSizeHigh) = 0; +DWORD (WINAPI* SFileSetFilePointer)(MPQHANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod) = 0; +BOOL (WINAPI* SFileReadFile)(MPQHANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) = 0; +LCID (WINAPI* SFileSetLocale)(LCID nNewLocale) = 0; +BOOL (WINAPI* SFileDestroy)() = 0; +BOOL (WINAPI* SFileGetArchiveName)(MPQHANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength) = 0; +BOOL (WINAPI* SFileGetFileName)(MPQHANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength) = 0; +BOOL (WINAPI* SFileGetFileArchive)(MPQHANDLE hFile, MPQHANDLE *hMPQ) = 0; +BOOL (WINAPI* SFileGetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength) = 0; +BOOL (WINAPI* SFileSetBasePath)(LPCSTR lpNewBasePath) = 0; STORMMODULE::STORMMODULE() { @@ -39,24 +41,7 @@ STORMMODULE::STORMMODULE() if (hStorm == NULL) hStorm = LoadLibrary(STORM_DLL); else AlreadyLoaded=TRUE; - if (hStorm != NULL) - { - SFileCloseArchive = (funcSFileCloseArchive)GetProcAddress(hStorm, (LPCSTR)0xFC); - SFileCloseFile = (funcSFileCloseFile)GetProcAddress(hStorm, (LPCSTR)0xFD); - SFileDestroy = (funcSFileDestroy)GetProcAddress(hStorm, (LPCSTR)0x106); - SFileGetFileArchive = (funcSFileGetFileArchive)GetProcAddress(hStorm, (LPCSTR)0x108); - SFileGetFileSize = (funcSFileGetFileSize)GetProcAddress(hStorm, (LPCSTR)0x109); - SFileOpenArchive = (funcSFileOpenArchive)GetProcAddress(hStorm, (LPCSTR)0x10A); - SFileOpenFile = (funcSFileOpenFile)GetProcAddress(hStorm, (LPCSTR)0x10B); - SFileOpenFileEx = (funcSFileOpenFileEx)GetProcAddress(hStorm, (LPCSTR)0x10C); - SFileReadFile = (funcSFileReadFile)GetProcAddress(hStorm, (LPCSTR)0x10D); - SFileSetBasePath = (funcSFileSetBasePath)GetProcAddress(hStorm, (LPCSTR)0x10E); - SFileSetFilePointer = (funcSFileSetFilePointer)GetProcAddress(hStorm, (LPCSTR)0x10F); - SFileSetLocale = (funcSFileSetLocale)GetProcAddress(hStorm, (LPCSTR)0x110); - SFileGetBasePath = (funcSFileGetBasePath)GetProcAddress(hStorm, (LPCSTR)0x111); - SFileGetArchiveName = (funcSFileGetArchiveName)GetProcAddress(hStorm, (LPCSTR)0x113); - SFileGetFileName = (funcSFileGetFileName)GetProcAddress(hStorm, (LPCSTR)0x114); - } + LoadStormFunctions(); if (SFileDestroy && !AlreadyLoaded) SFileDestroy(); } @@ -73,29 +58,34 @@ HINSTANCE LoadStorm(char * DllFileName) if (hStorm == NULL) hStorm = LoadLibrary(DllFileName); else AlreadyLoaded=TRUE; - if (hStorm != NULL) - { - SFileCloseArchive = (funcSFileCloseArchive)GetProcAddress(hStorm, (LPCSTR)0xFC); - SFileCloseFile = (funcSFileCloseFile)GetProcAddress(hStorm, (LPCSTR)0xFD); - SFileDestroy = (funcSFileDestroy)GetProcAddress(hStorm, (LPCSTR)0x106); - SFileGetFileArchive = (funcSFileGetFileArchive)GetProcAddress(hStorm, (LPCSTR)0x108); - SFileGetFileSize = (funcSFileGetFileSize)GetProcAddress(hStorm, (LPCSTR)0x109); - SFileOpenArchive = (funcSFileOpenArchive)GetProcAddress(hStorm, (LPCSTR)0x10A); - SFileOpenFile = (funcSFileOpenFile)GetProcAddress(hStorm, (LPCSTR)0x10B); - SFileOpenFileEx = (funcSFileOpenFileEx)GetProcAddress(hStorm, (LPCSTR)0x10C); - SFileReadFile = (funcSFileReadFile)GetProcAddress(hStorm, (LPCSTR)0x10D); - SFileSetBasePath = (funcSFileSetBasePath)GetProcAddress(hStorm, (LPCSTR)0x10E); - SFileSetFilePointer = (funcSFileSetFilePointer)GetProcAddress(hStorm, (LPCSTR)0x10F); - SFileSetLocale = (funcSFileSetLocale)GetProcAddress(hStorm, (LPCSTR)0x110); - SFileGetBasePath = (funcSFileGetBasePath)GetProcAddress(hStorm, (LPCSTR)0x111); - SFileGetArchiveName = (funcSFileGetArchiveName)GetProcAddress(hStorm, (LPCSTR)0x113); - SFileGetFileName = (funcSFileGetFileName)GetProcAddress(hStorm, (LPCSTR)0x114); - } + LoadStormFunctions(); if (SFileDestroy && !AlreadyLoaded) SFileDestroy(); if (AlreadyLoaded==TRUE) return 0; return hStorm; } +void LoadStormFunctions() +{ + if (hStorm != NULL) + { + *(FARPROC *)&SFileCloseArchive = GetProcAddress(hStorm, (LPCSTR)0xFC); + *(FARPROC *)&SFileCloseFile = GetProcAddress(hStorm, (LPCSTR)0xFD); + *(FARPROC *)&SFileDestroy = GetProcAddress(hStorm, (LPCSTR)0x106); + *(FARPROC *)&SFileGetFileArchive = GetProcAddress(hStorm, (LPCSTR)0x108); + *(FARPROC *)&SFileGetFileSize = GetProcAddress(hStorm, (LPCSTR)0x109); + *(FARPROC *)&SFileOpenArchive = GetProcAddress(hStorm, (LPCSTR)0x10A); + *(FARPROC *)&SFileOpenFile = GetProcAddress(hStorm, (LPCSTR)0x10B); + *(FARPROC *)&SFileOpenFileEx = GetProcAddress(hStorm, (LPCSTR)0x10C); + *(FARPROC *)&SFileReadFile = GetProcAddress(hStorm, (LPCSTR)0x10D); + *(FARPROC *)&SFileSetBasePath = GetProcAddress(hStorm, (LPCSTR)0x10E); + *(FARPROC *)&SFileSetFilePointer = GetProcAddress(hStorm, (LPCSTR)0x10F); + *(FARPROC *)&SFileSetLocale = GetProcAddress(hStorm, (LPCSTR)0x110); + *(FARPROC *)&SFileGetBasePath = GetProcAddress(hStorm, (LPCSTR)0x111); + *(FARPROC *)&SFileGetArchiveName = GetProcAddress(hStorm, (LPCSTR)0x113); + *(FARPROC *)&SFileGetFileName = GetProcAddress(hStorm, (LPCSTR)0x114); + } +} + void FreeStorm() { SFileCloseArchive = 0; diff --git a/loadstorm/Storm.h b/loadstorm/Storm.h index cfadd7f..7aaaf81 100644 --- a/loadstorm/Storm.h +++ b/loadstorm/Storm.h @@ -1,3 +1,5 @@ +/* License information for this code is in license.txt */ + #ifndef STORM_H_INCLUDED #define STORM_H_INCLUDED @@ -19,38 +21,21 @@ extern HINSTANCE LoadStorm(char * DllFileName); #define MPQHANDLE HANDLE // Storm Function Prototypes -typedef BOOL (WINAPI* funcSFileOpenArchive)(LPCSTR lpFilename, DWORD dwPriority, DWORD dwFlags, MPQHANDLE *hMPQ); -typedef BOOL (WINAPI* funcSFileCloseArchive)(MPQHANDLE hMPQ); -typedef BOOL (WINAPI* funcSFileOpenFile)(LPCSTR lpFileName, MPQHANDLE *hFile); -typedef BOOL (WINAPI* funcSFileOpenFileEx)(MPQHANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, MPQHANDLE *hFile); -typedef BOOL (WINAPI* funcSFileCloseFile)(MPQHANDLE hFile); -typedef DWORD (WINAPI* funcSFileGetFileSize)(MPQHANDLE hFile, LPDWORD lpFileSizeHigh); -typedef DWORD (WINAPI* funcSFileSetFilePointer)(MPQHANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod); -typedef BOOL (WINAPI* funcSFileReadFile)(MPQHANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped); -typedef LCID (WINAPI* funcSFileSetLocale)(LCID nNewLocale); -typedef BOOL (WINAPI* funcSFileDestroy)(); -typedef BOOL (WINAPI* funcSFileGetArchiveName)(MPQHANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength); -typedef BOOL (WINAPI* funcSFileGetFileName)(MPQHANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength); -typedef BOOL (WINAPI* funcSFileGetFileArchive)(MPQHANDLE hFile, MPQHANDLE *hMPQ); -typedef BOOL (WINAPI* funcSFileGetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength); -typedef BOOL (WINAPI* funcSFileSetBasePath)(LPCSTR lpNewBasePath); - -// Storm Function Names -extern funcSFileCloseArchive SFileCloseArchive; -extern funcSFileCloseFile SFileCloseFile; -extern funcSFileDestroy SFileDestroy; -extern funcSFileGetFileArchive SFileGetFileArchive; -extern funcSFileGetFileSize SFileGetFileSize; -extern funcSFileOpenArchive SFileOpenArchive; -extern funcSFileOpenFile SFileOpenFile; -extern funcSFileOpenFileEx SFileOpenFileEx; -extern funcSFileReadFile SFileReadFile; -extern funcSFileSetBasePath SFileSetBasePath; -extern funcSFileSetFilePointer SFileSetFilePointer; -extern funcSFileSetLocale SFileSetLocale; -extern funcSFileGetBasePath SFileGetBasePath; -extern funcSFileGetArchiveName SFileGetArchiveName; -extern funcSFileGetFileName SFileGetFileName; +extern BOOL (WINAPI* SFileOpenArchive)(LPCSTR lpFilename, DWORD dwPriority, DWORD dwFlags, MPQHANDLE *hMPQ); +extern BOOL (WINAPI* SFileCloseArchive)(MPQHANDLE hMPQ); +extern BOOL (WINAPI* SFileOpenFile)(LPCSTR lpFileName, MPQHANDLE *hFile); +extern BOOL (WINAPI* SFileOpenFileEx)(MPQHANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, MPQHANDLE *hFile); +extern BOOL (WINAPI* SFileCloseFile)(MPQHANDLE hFile); +extern DWORD (WINAPI* SFileGetFileSize)(MPQHANDLE hFile, LPDWORD lpFileSizeHigh); +extern DWORD (WINAPI* SFileSetFilePointer)(MPQHANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod); +extern BOOL (WINAPI* SFileReadFile)(MPQHANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); +extern LCID (WINAPI* SFileSetLocale)(LCID nNewLocale); +extern BOOL (WINAPI* SFileDestroy)(); +extern BOOL (WINAPI* SFileGetArchiveName)(MPQHANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength); +extern BOOL (WINAPI* SFileGetFileName)(MPQHANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength); +extern BOOL (WINAPI* SFileGetFileArchive)(MPQHANDLE hFile, MPQHANDLE *hMPQ); +extern BOOL (WINAPI* SFileGetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength); +extern BOOL (WINAPI* SFileSetBasePath)(LPCSTR lpNewBasePath); #ifdef __cplusplus }; // extern "C"