--- spal60sr\src\TSSGCtrl\SSBundleList.original.cpp	Sun Apr  6 21:43:38 2003
+++ spal60sr\src\TSSGCtrl\SSBundleList.cpp	Sun Apr  6 21:43:38 2003
@@ -1,5 +1,23 @@
 #include "SSBundleList.h"
 
+#define LOCAL_MEMORY_SUPPORT 1
+#define ERRORSKIP_SUPPORT    1
+
+#if defined(LOCAL_MEMORY_SUPPORT) && LOCAL_MEMORY_SUPPORT
+#if defined(IO_FEP_SUPPORT) && IO_FEP_SUPPORT
+void __stdcall TSSGSubject_CheckFEPParam(TSSGSubject *_this, const string *s);
+BOOLEAN __stdcall TSSGCtrl_OneRead_with_CheckLocalMemory_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr);
+BOOLEAN __stdcall TSSGCtrl_OneWrite_with_CheckLocalMemory_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr);
+#else
+BOOLEAN __stdcall TSSGCtrl_OneRead_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr);
+BOOLEAN __stdcall TSSGCtrl_OneWrite_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr);
+#endif
+#endif
+
+#if defined(ERRORSKIP_SUPPORT) && ERRORSKIP_SUPPORT
+#define AT_ERRORSKIP 0x2000
+#endif
+
 //---------------------------------------------------------------------
 //uݒ֐v
 //
@@ -13,6 +31,10 @@
  vector<string> tmpV;
  
  SSGC.strD.List(code+SSGC.GetEndWith(this), ",", &tmpV, strD::etTRIM+strD::dtESCAPE);
+#if defined(IO_FEP_SUPPORT) && IO_FEP_SUPPORT
+ if (tmpV.size() >= 7)
+	TSSGSubject_CheckFEPParam(this, &tmpV[6]);
+#endif
  tmpV.resize(6);	//K萔
  
  addressStr = tmpV[0];
@@ -58,14 +80,26 @@
  Setting(SSGC);
  
  TSmartHandle SHandle;
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
  if(( SHandle=SSGC.processCtrl.Open(PROCESS_VM_READ) )==NULL)
 	return ssgCtrl::reOPEN_ERROR;	//vZX̃I[vG[
+#else
+ SHandle = SSGC.processCtrl.Open(PROCESS_VM_READ);
+#endif
 
+#if !defined(SUBJECT_STATUS) || !SUBJECT_STATUS
  if(!SSGC.IsEnabled(this)) return ssgCtrl::reNOT_ENABLED;	//LU
+#else
+ if(!SSGC.IsEnabled(this, TRUE)) return ssgCtrl::reNOT_ENABLED;	//LU
+#endif
 
 
  //ItZbgp̃AhXɂ́A[replace]̑tȂ
+#if !defined(SUBJECT_STATUS) || !SUBJECT_STATUS
  unsigned long Address = (isOffset)?SSGC.GetAddress(this, addressStr, 0):0;
+#else
+ unsigned long Address = (isOffset) ? (unsigned long)(address = (const BYTE *)SSGC.GetAddress(this, addressStr, 0)) : 0;
+#endif
 
  if(size==0)	//Setting()ł̓t@CJȂ
 	return ssgCtrl::reOPTION_ERROR;	//Xgt@CȂI
@@ -81,7 +115,13 @@
 	
 	ThisAddress = Address+SSGC.GetAddress(this, ListFile->at(i));
 
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
 	if(!SSGC.OneRead(this, SHandle, ThisAddress, &Val, size)) 
+#elif !defined(IO_FEP_SUPPORT) || !IO_FEP_SUPPORT
+	if (!TSSGCtrl_OneRead_with_CheckLocalMemory(&SSGC, this, SHandle, ThisAddress, &Val, size, ListFile->at(i)))
+#else
+	if (!TSSGCtrl_OneRead_with_CheckLocalMemory_CheckIO_FEP(&SSGC, this, SHandle, ThisAddress, &Val, size, ListFile->at(i)))
+#endif
 		return ssgCtrl::reACCESS_ERROR;	//G[Ȃ1Ԃ
 	
 	TotalVal += Val;
@@ -105,14 +145,22 @@
  Setting(SSGC);
 
  TSmartHandle SHandle;
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
  if(( SHandle=SSGC.Open(this, PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_VM_OPERATION) )==NULL)
 	return ssgCtrl::reOPEN_ERROR;	//vZX̃I[vG[
+#else
+ SHandle = SSGC.Open(this, PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION);
+#endif
 
  if(!SSGC.IsEnabled(this)) return ssgCtrl::reNOT_ENABLED;	//LU
 
 
  //ItZbgp̃AhXɂ́A[replace]̑tȂ
+#if !defined(SUBJECT_STATUS) || !SUBJECT_STATUS
  unsigned long Address = (isOffset)?SSGC.GetAddress(this, addressStr, 0):0;
+#else
+ unsigned long Address = (isOffset) ? (unsigned long)(address = (const BYTE *)SSGC.GetAddress(this, addressStr, 0)) : 0;
+#endif
 
  vector<string> *ListFile = SSGC.GetSSGDataFile(this, chainFileName, ".CHN");
  if(ListFile==NULL) return ssgCtrl::reOPTION_ERROR;	//`FCt@CȂI
@@ -126,7 +174,16 @@
 
 	ThisAddress = Address+SSGC.GetAddress(this, ListFile->at(i));
 
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
 	if(!SSGC.OneWrite(this, SHandle, ThisAddress, &Val, size))	//G[Ȃ
+#elif !defined(IO_FEP_SUPPORT) || !IO_FEP_SUPPORT
+	if (!TSSGCtrl_OneWrite_with_CheckLocalMemory(&SSGC, this, SHandle, ThisAddress, &Val, size, ListFile->at(i)))	//G[Ȃ
+#else
+	if (!TSSGCtrl_OneWrite_with_CheckLocalMemory_CheckIO_FEP(&SSGC, this, SHandle, ThisAddress, &Val, size, ListFile->at(i)))	//G[Ȃ
+#endif
+#if defined(ERRORSKIP_SUPPORT) && ERRORSKIP_SUPPORT
+	if (!SSGC.GetAttribute(this, AT_ERRORSKIP))
+#endif
  		return ssgCtrl::reACCESS_ERROR;
  	
  }
