Back to index

lightning-sunbird  0.9+nobinonly
extra.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Sean Su <ssu@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef _EXTRA_H_
00041 #define _EXTRA_H_
00042 
00043 #include <windows.h>
00044 
00045 typedef struct diskSpaceNode dsN;
00046 struct diskSpaceNode
00047 {
00048   ULONGLONG       ullSpaceRequired;
00049   LPSTR           szPath;
00050   dsN             *Next;
00051   dsN             *Prev;
00052 };
00053 
00054 typedef struct structVer
00055 {
00056   ULONGLONG ullMajor;
00057   ULONGLONG ullMinor;
00058   ULONGLONG ullRelease;
00059   ULONGLONG ullBuild;
00060 } verBlock;
00061 
00062 BOOL              InitApplication(HINSTANCE hInstance);
00063 BOOL              InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
00064 void              PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
00065 void              FreeMemory(void **vPointer);
00066 void              *NS_GlobalAlloc(DWORD dwMaxBuf);
00067 HRESULT           Initialize(HINSTANCE hInstance);
00068 HRESULT           NS_LoadStringAlloc(HANDLE hInstance, DWORD dwID, LPSTR *szStringBuf, DWORD dwStringBuf);
00069 HRESULT           NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwStringBuf);
00070 HRESULT           WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, int iShowCmd, BOOL bWait);
00071 HRESULT           ParseConfigIni(LPSTR lpszCmdLine);
00072 HRESULT           DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
00073 HRESULT           DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
00074 void              GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
00075 void              SetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, DWORD dwType, LPSTR szData, DWORD dwSize);
00076 void              SetWinRegNumValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName, DWORD dwData);
00077 HRESULT           InitUninstallGeneral(void);
00078 HRESULT           InitDlgUninstall(diU *diDialog);
00079 sil               *CreateSilNode();
00080 void              SilNodeInsert(sil *silHead, sil *silTemp);
00081 void              SilNodeDelete(sil *silTemp);
00082 void              DeInitialize(void);
00083 void              DeInitDlgUninstall(diU *diDialog);
00084 void              DetermineOSVersion(void);
00085 void              DeInitILomponents(void);
00086 void              DeInitUninstallGeneral(void);
00087 HRESULT           ParseUninstallIni();
00088 void              ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwLength, DWORD dwType);
00089 void              RemoveBackSlash(LPSTR szInput);
00090 void              AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
00091 void              RemoveSlash(LPSTR szInput);
00092 void              AppendSlash(LPSTR szInput, DWORD dwInputSize);
00093 HRESULT           FileExists(LPSTR szFile);
00094 BOOL              MakeUniquePath(LPSTR szPath);
00095 BOOL              IsWin95Debute(void);
00096 HRESULT           CheckInstances();
00097 BOOL              GetFileVersion(LPSTR szFile, verBlock *vbVersion);
00098 BOOL              CheckLegacy(HWND hDlg);
00099 int               CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
00100 void              RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
00101 int               MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
00102 LPSTR             GetFirstSpace(LPSTR lpszString);
00103 LPSTR             GetFirstNonSpace(LPSTR lpszString);
00104 LPSTR             MozStrChar(LPSTR lpszString, char c);
00105 int               GetArgC(LPSTR lpszCommandLine);
00106 LPSTR             GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize);
00107 DWORD             ParseCommandLine(LPSTR lpszCmdLine);
00108 void              SetUninstallRunMode(LPSTR szMode);
00109 void              Delay(DWORD dwSeconds);
00110 HRESULT           GetAppPath();
00111 DWORD             CleanupAppList();
00112 DWORD             ProcessAppItem(HKEY hkRoot, LPSTR szKeyAppList, LPSTR szAppID);
00113 void              RemovePathToExeXX(HKEY hkRootKey, LPSTR szKey, DWORD dwIndex, const DWORD dwUpperLimit);
00114 HRESULT           GetUninstallLogPath();
00115 BOOL              WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
00116 void              DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
00117 void              ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
00118 BOOL              IsPathWithinWindir(char *aTargetPath);
00119 void              VerifyAndDeleteInstallationFolder(void);
00120 
00121 #endif /* _EXTRA_H_ */
00122