// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxmt.h>            // MFC support for thread synchronization

#include "gcommlib.h"
#include "majorbbs.h"
#include "integrou.h"
#include "gcspsrv.h"
#include "gcwinver.h"
#include "galnssf.h"

#define WM_THREADFINISHED (WM_USER+1)

extern CStatic* pST;
extern CProgressCtrl* pPRG;
extern GBOOL isService;
extern GBOOL bReqWarned;

// WGSINT.CPP
VOID wgsint(VOID);
VOID regntxt(VOID);
INT fndmod(CHAR *modnam);
VOID iconchek(VOID);
VOID iconrev(VOID);

// ANYCHG.CPP
GBOOL anychg(GBOOL firsttime);

// SVC.CPP
GBOOL isWgstartRunning(VOID);

// INTEGROU.CPP
static VOID wrtmdf(VOID);
static VOID wrtutl(VOID);
static VOID tagreq(struct moddat *mddptr);
static VOID adddll(CHAR **dllist,CHAR *dllnam);
static VOID bldmda(VOID);
static VOID interp(VOID);
static VOID wrapit(VOID);
static VOID dwreps(VOID);
static GBOOL repifs(CHAR *target,CHAR *source,CHAR *cmpstg);
static VOID zapmod(INT imod);
static VOID plinfo(VOID);
static INT dupsok(VOID);
static VOID resolv(INT i,INT j);
static GBOOL validch(CHAR c,CHAR *stg);
static VOID dsamdf(INT i);
static VOID renmod(INT i,CHAR *newi);
static VOID addxmod(VOID);
static VOID warnem(VOID);
static VOID reqwarn(CHAR *mdfnam);
static VOID w4morc(VOID);
static VOID record(VOID);
static VOID ssfapp(VOID);
static VOID rfrapp(VOID);
static VOID zapapps(VOID);
static VOID zapapp(CHAR *appid);
static VOID zappem(struct saunam *szap);
static VOID addapp(CHAR *appid);
static INT addssfs(INT ssupfs,CHAR *appid,CHAR *files,struct saunam *adder);
static struct moddat *fndapp(CHAR *appid);
static VOID opncsf(VOID);
static VOID clscsf(VOID);
static VOID bestssf(CHAR *appid,CHAR *filnam);
static VOID ssfiler(VOID);