Index: trunk/ab5.0/abdev/ab_common/src/Environment.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Environment.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Environment.cpp	(revision 828)
@@ -1,4 +1,6 @@
 #include "stdafx.h"
 #include <uxtheme.h>
+
+DWORD const PROCESS_DEP_ENABLE = 0x00000001;
 
 std::string ActiveBasic::Common::Environment::rootPath;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 #include <algorithm>
 #include <boost/checked_delete.hpp>
@@ -777,17 +779,16 @@
 
 	std::vector<const CClass *> classes;
-	const CClass *pClass = GetHashArrayElement( symbol.GetName().c_str() );
-	while( pClass )
-	{
-		if( pClass->IsEqualSymbol( symbol.GetNamespaceScopes(), symbol.GetName() ) ){
+	foreach (auto pClass, GetHashArrayElement(symbol.GetName()))
+	{
+		if ( pClass->IsEqualSymbol(symbol.GetNamespaceScopes(), symbol.GetName()))
+		{
 			//名前空間とクラス名が一致した
 			classes.push_back( pClass );
 		}
-		pClass = pClass->GetChainNext();
 	}
 	if( classes.size() > 0 )
 	{
 		// 複数の名前空間の中に同一のクラス名が存在する場合があるので、アクセス可能で尚且つ階層が一番深いものをチョイスする
-		pClass = classes.front();
+		auto pClass = classes.front();
 
 		foreach( const CClass *pTempClass, classes )
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp	(revision 828)
@@ -29,15 +29,10 @@
 CConst *Consts::GetObjectPtr( const Symbol &symbol )
 {
-	CConst *pConst = GetHashArrayElement( symbol.GetName().c_str() );
-	while( pConst )
-	{
-		if( pConst->IsEqualSymbol( symbol ) )
-		{
-			break;
-		}
-		pConst = pConst->GetChainNext();
-	}
-
-	return pConst;
+	auto c = GetHashArrayElement(symbol.GetName());
+	auto it = std::find_if(c.begin(), c.end(),
+		[&](CConst* t) {return t->IsEqualSymbol(symbol);});
+	return it != c.end()
+		? *it
+		: nullptr;
 }
 
@@ -131,14 +126,9 @@
 ConstMacro *ConstMacros::Find( const Symbol &symbol )
 {
-	ConstMacro *pConstMacro = GetHashArrayElement( symbol.GetName().c_str() );
-	while( pConstMacro )
-	{
-		if( pConstMacro->IsEqualSymbol( symbol ) )
-		{
-			break;
-		}
-		pConstMacro = pConstMacro->GetChainNext();
-	}
-
-	return pConstMacro;
+	auto c = GetHashArrayElement(symbol.GetName());
+	auto it = std::find_if(c.begin(), c.end(),
+		[&](ConstMacro* t) {return t->IsEqualSymbol(symbol);});
+	return it != c.end()
+		? *it
+		: nullptr;
 }
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 Interface::Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters )
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Member.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Member.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Member.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp	(revision 828)
@@ -37,5 +37,5 @@
 {
 	// 名前空間
-	BOOST_FOREACH( NamespaceScopes &namespaceScopes, meta.namespaceScopesCollection )
+	foreach (NamespaceScopes const &namespaceScopes, meta.namespaceScopesCollection)
 	{
 		if( !this->namespaceScopesCollection.IsExist( namespaceScopes ) )
@@ -46,8 +46,6 @@
 
 	// 関数・メソッド
-	meta.GetUserProcs().Iterator_Reset();
-	while( meta.GetUserProcs().Iterator_HasNext() )
-	{
-		UserProc *pUserProc = meta.GetUserProcs().Iterator_GetNext();
+	foreach (auto pUserProc, meta.GetUserProcs())
+	{
 		if( pUserProc->IsExternal() )
 		{
@@ -65,8 +63,6 @@
 
 	// DLL関数
-	meta.GetDllProcs().Iterator_Reset();
-	while( meta.GetDllProcs().Iterator_HasNext() )
-	{
-		DllProc *pDllProc = meta.GetDllProcs().Iterator_GetNext();
+	foreach (auto pDllProc, meta.GetDllProcs())
+	{
 		if( pDllProc->IsExternal() )
 		{
@@ -81,8 +77,6 @@
 
 	// クラス
-	meta.GetClasses().Iterator_Reset();
-	while( meta.GetClasses().Iterator_HasNext() )
-	{
-		CClass *pClass = meta.GetClasses().Iterator_GetNext();
+	foreach (auto pClass, meta.GetClasses())
+	{
 		if( pClass->IsExternal() )
 		{
@@ -132,8 +126,6 @@
 
 	// グローバル定数
-	meta.GetGlobalConsts().Iterator_Reset();
-	while( meta.GetGlobalConsts().Iterator_HasNext() )
-	{
-		CConst *pConst = meta.GetGlobalConsts().Iterator_GetNext();
+	foreach (auto pConst, meta.GetGlobalConsts())
+	{
 		if( pConst->IsExternal() )
 		{
@@ -148,8 +140,6 @@
 
 	// グローバル定数マクロ
-	meta.GetGlobalConstMacros().Iterator_Reset();
-	while( meta.GetGlobalConstMacros().Iterator_HasNext() )
-	{
-		ConstMacro *pConstMacro = meta.GetGlobalConstMacros().Iterator_GetNext();
+	foreach (auto pConstMacro, meta.GetGlobalConstMacros())
+	{
 		if( pConstMacro->IsExternal() )
 		{
@@ -200,8 +190,6 @@
 
 	// デリゲート
-	meta.GetDelegates().Iterator_Reset();
-	while( meta.GetDelegates().Iterator_HasNext() )
-	{
-		Delegate *pDelegate = meta.GetDelegates().Iterator_GetNext();
+	foreach (auto pDelegate, meta.GetDelegates())
+	{
 		if( pDelegate->IsExternal() )
 		{
@@ -218,15 +206,14 @@
 const ::Delegate &Meta::ToDelegate( const CClass &_class )
 {
-	const ::Delegate *dg = this->GetDelegates().GetHashArrayElement( _class.GetName().c_str() );
-	while( dg )
-	{
-		if( dg->IsEqualSymbol( _class.GetNamespaceScopes(), _class.GetName() ) ){
+	auto dg = this->GetDelegates().GetHashArrayElement(_class.GetName());
+	foreach (auto t, dg)
+	{
+		if( t->IsEqualSymbol( _class.GetNamespaceScopes(), _class.GetName() ) ){
 			//名前空間とクラス名が一致した
-			return *dg;
-		}
-		dg = dg->GetChainNext();
-	}
-
-	throw;
+			return *t;
+		}
+	}
+
+	throw std::runtime_error("Meta::ToDelegate");
 }
 
@@ -256,27 +243,18 @@
 {
 	// 関数・メソッド
-	this->GetUserProcs().Iterator_Init();
-	this->GetUserProcs().Iterator_Reset();
-	while( this->GetUserProcs().Iterator_HasNext() )
-	{
-		UserProc *pUserProc = this->GetUserProcs().Iterator_GetNext();
+	foreach (auto pUserProc, this->GetUserProcs())
+	{
 		pUserProc->Resolve( resolver, resolveErrors );
 	}
 
 	// DLL関数
-	this->GetDllProcs().Iterator_Init();
-	this->GetDllProcs().Iterator_Reset();
-	while( this->GetDllProcs().Iterator_HasNext() )
-	{
-		DllProc *pDllProc = this->GetDllProcs().Iterator_GetNext();
+	foreach (auto pDllProc, this->GetDllProcs())
+	{
 		pDllProc->Resolve( resolver, resolveErrors );
 	}
 
 	// クラス
-	this->GetClasses().Iterator_Init();
-	this->GetClasses().Iterator_Reset();
-	while( this->GetClasses().Iterator_HasNext() )
-	{
-		CClass *pClass = this->GetClasses().Iterator_GetNext();
+	foreach (auto pClass, this->GetClasses())
+	{
 		pClass->Resolve( resolver, resolveErrors );
 	}
@@ -289,18 +267,12 @@
 
 	// グローバル定数
-	this->GetGlobalConsts().Iterator_Init();
-	this->GetGlobalConsts().Iterator_Reset();
-	while( this->GetGlobalConsts().Iterator_HasNext() )
-	{
-		CConst *pConst = this->GetGlobalConsts().Iterator_GetNext();
+	foreach (auto pConst, this->GetGlobalConsts())
+	{
 		pConst->Resolve( resolver, resolveErrors );
 	}
 
 	// グローバル定数マクロ
-	this->GetGlobalConstMacros().Iterator_Init();
-	this->GetGlobalConstMacros().Iterator_Reset();
-	while( this->GetGlobalConstMacros().Iterator_HasNext() )
-	{
-		ConstMacro *pConstMacro = this->GetGlobalConstMacros().Iterator_GetNext();
+	foreach (auto pConstMacro, this->GetGlobalConstMacros())
+	{
 		pConstMacro->Resolve( resolver, resolveErrors );
 	}
@@ -325,9 +297,6 @@
 
 	// デリゲート
-	this->GetDelegates().Iterator_Init();
-	this->GetDelegates().Iterator_Reset();
-	while( this->GetDelegates().Iterator_HasNext() )
-	{
-		Delegate *pDelegate = this->GetDelegates().Iterator_GetNext();
+	foreach (auto pDelegate, this->GetDelegates())
+	{
 		pDelegate->Resolve( resolver, resolveErrors );
 	}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Method.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Method.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Method.cpp	(revision 828)
@@ -1,3 +1,6 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
+#include <stdexcept>
 
 bool CMethod::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors )
@@ -75,5 +78,5 @@
 {
 	// 静的メソッドがコピーコンストラトされることは想定しない
-	throw;
+	throw std::domain_error("静的メソッドのコピー構築に対応していない");
 }
 
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 #include <algorithm>
 
@@ -16,5 +18,5 @@
 		std::string tempName = namespaceStr.substr( i, i2-i );
 
-		push_back( tempName );
+		push_back(std::move(tempName));
 
 		if( i2 == std::string::npos ){
@@ -26,11 +28,7 @@
 }
 
-NamespaceScopes NamespaceScopes::operator+ ( const NamespaceScopes &namespaceScopes ) const
+NamespaceScopes ActiveBasic::Common::Lexical::operator +(const NamespaceScopes &lhs, const NamespaceScopes &rhs)
 {
-	NamespaceScopes result;
-	result.reserve( this->size() + namespaceScopes.size() );
-	result = *this;
-	result.append( namespaceScopes );
-	return result;
+	return NamespaceScopes(lhs) += rhs;
 }
 
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/NamespaceSupporter.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/NamespaceSupporter.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/NamespaceSupporter.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 using namespace ActiveBasic::Common::Lexical;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 #define BREAK_EIP(checkEip)  (obp+0x00401000>=checkEip)
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp	(revision 828)
@@ -1,3 +1,3 @@
-#pragma warning(disable : 4996)
+//#pragma warning(disable : 4996)
 
 #include <map>
@@ -29,4 +29,6 @@
 
 
+#pragma warning(push)
+#pragma warning(disable: 4244 6011 6326)
 #ifdef OBJECT_MODULE_IS_NOT_BINARY
 #include <boost/archive/xml_oarchive.hpp>
@@ -42,8 +44,8 @@
 #include <boost/serialization/map.hpp>
 #include <boost/serialization/version.hpp>
-#include <boost/serialization/is_abstract.hpp>
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/export.hpp>
+#pragma warning(pop)
 
 #define foreach(v, c) for each (v in c)
@@ -252,2 +254,5 @@
 	return isSuccessful;
 }
+
+BOOST_CLASS_EXPORT_IMPLEMENT( DynamicMethod );
+BOOST_CLASS_EXPORT_IMPLEMENT( StaticMethod );
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Parameter.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Parameter.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Parameter.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 Parameter::Parameter( const std::string &varName, const Type &type, bool isRef, const std::string initValue )
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 
@@ -243,6 +245,6 @@
 
 	// ハッシュ値を取得
-	UserProc *pUserProc = GetHashArrayElement( simpleName );
-	while(pUserProc){
+	foreach (auto pUserProc, GetHashArrayElement( simpleName ))
+	{
 		if( pUserProc->IsGlobalProcedure() ){
 			if( pUserProc->IsEqualSymbol( localSymbol ) ){
@@ -250,6 +252,4 @@
 			}
 		}
-
-		pUserProc=pUserProc->GetChainNext();
 	}
 }
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 828)
@@ -945,28 +945,2 @@
 	return true;
 }
-
-int SourceCodePosition::GetRelationalObjectModuleIndex() const
-{
-	if( this->IsNothing() )
-	{
-		_ASSERTE( false );
-		throw;
-	}
-
-	return relationalObjectModuleIndex;
-}
-bool SourceCodePosition::IsNothing() const
-{
-	if( this->relationalObjectModuleIndex == -1 && this->pos == -1 )
-	{
-		return true;
-	}
-
-	if( this->relationalObjectModuleIndex == -1 || this->pos == -1 )
-	{
-		_ASSERTE( false );
-		throw;
-	}
-
-	return false;
-}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/SourceCodePosition.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/SourceCodePosition.cpp	(revision 828)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/SourceCodePosition.cpp	(revision 828)
@@ -0,0 +1,29 @@
+#include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
+
+int SourceCodePosition::GetRelationalObjectModuleIndex() const
+{
+	if( this->IsNothing() )
+	{
+		_ASSERTE( false );
+		throw std::runtime_error("SourceCodePosition::GetRelationalObjectModuleIndex");
+	}
+
+	return relationalObjectModuleIndex;
+}
+bool SourceCodePosition::IsNothing() const
+{
+	if( this->relationalObjectModuleIndex == -1 && this->pos == -1 )
+	{
+		return true;
+	}
+
+	if( this->relationalObjectModuleIndex == -1 || this->pos == -1 )
+	{
+		_ASSERTE( false );
+		throw std::runtime_error("SourceCodePosition::IsNothing");
+	}
+
+	return false;
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 using namespace ActiveBasic::Common::Lexical;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Template.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Template.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Template.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 ExpandedTemplateClass::~ExpandedTemplateClass()
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Type.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Type.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Type.cpp	(revision 828)
@@ -1,3 +1,6 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
+#include "Lexical/Type.h"
 
 const int Type::basicTypeList[] = {
@@ -539,10 +542,13 @@
 
 int Type::GetBasicTypeFromSimpleName( const char *variable ){
-	extern char DefIntVari[26],DefSngVari[26],DefStrVari[26],divNum,dsvNum,dStrvNum;
+	assert(variable != nullptr);
+	auto length = std::strlen(variable);
+	assert(length > 0);
+
 	int i;
 	char name[VN_SIZE];
 
 	//構造体メンバの場合を考慮
-	for(i=lstrlen(variable);i>0;i--){
+	for(i=length;i>0;i--){
 		if(variable[i]=='.'){
 			i++;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp	(revision 828)
@@ -1,3 +1,5 @@
 #include "stdafx.h"
+#include <jenga/include/jenga.h>
+#include <abdev/ab_common/include/ab_common.h>
 
 TypeDef::TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType )
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp	(revision 828)
@@ -12,4 +12,5 @@
 {
 }
+
 Variable::Variable( const Variable &var )
 	: RelationalObjectModuleItem( var )
@@ -24,6 +25,34 @@
 {
 }
+
+Variable::Variable(Variable&& var)
+	: RelationalObjectModuleItem(std::move(var))
+	, type(std::move(var.type))
+	, isConst(std::move(var.isConst))
+	, isRef(std::move(var.isRef))
+	, isArray(std::move(var.isArray))
+	, subscripts(std::move(var.subscripts))
+	, isParameter(std::move(var.isParameter))
+	, paramStrForConstructor(std::move(var.paramStrForConstructor))
+	, hasInitData(std::move(var.hasInitData))
+{
+}
+
 Variable::Variable()
 {
+}
+
+Variable& Variable::operator =(Variable&& var)
+{
+	RelationalObjectModuleItem::operator =(std::move(var));
+	type = std::move(var.type);
+	isConst = std::move(var.isConst);
+	isRef = std::move(var.isRef);
+	isArray = std::move(var.isArray);
+	subscripts = std::move(var.subscripts);
+	isParameter = std::move(var.isParameter);
+	paramStrForConstructor = std::move(var.paramStrForConstructor);
+	hasInitData = std::move(var.hasInitData);
+	return *this;
 }
 
Index: trunk/ab5.0/abdev/ab_common/src/OSVersion.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/OSVersion.cpp	(revision 828)
+++ trunk/ab5.0/abdev/ab_common/src/OSVersion.cpp	(revision 828)
@@ -0,0 +1,16 @@
+#include "stdafx.h"
+
+namespace ActiveBasic { namespace Common {
+
+OSVERSIONINFO const& GetOSVersion()
+{
+	static OSVERSIONINFO vi;
+	if (vi.dwOSVersionInfoSize == 0)
+	{
+		vi.dwOSVersionInfoSize = sizeof vi;
+		::GetVersionEx(&vi);
+	}
+	return vi;
+}
+
+}}
Index: trunk/ab5.0/abdev/ab_common/src/Path.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Path.cpp	(revision 828)
+++ trunk/ab5.0/abdev/ab_common/src/Path.cpp	(revision 828)
@@ -0,0 +1,26 @@
+#include "stdafx.h"
+#include <boost/range/algorithm.hpp>
+#include <string.h>
+#include "OSVersion.h"
+
+namespace ActiveBasic { namespace Common {
+
+bool IsPathEqual(LPCWSTR lhs, LPCWSTR rhs)
+{
+	std::vector<WCHAR> l(lhs, lhs + std::wcslen(lhs) + 1);
+	std::vector<WCHAR> r(rhs, rhs + std::wcslen(rhs) + 1);
+	if (Is9x())
+	{
+		auto const& ct = std::use_facet<std::ctype<wchar_t>>(std::locale::classic());
+		ct.toupper(l.data(), l.data() + l.size());
+		ct.toupper(r.data(), r.data() + r.size());
+	}
+	else
+	{
+		::CharUpperW(l.data());
+		::CharUpperW(l.data());
+	}
+	return boost::equal(l, r);
+}
+
+}}
Index: trunk/ab5.0/abdev/ab_common/src/ProcessAndModule.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/ProcessAndModule.cpp	(revision 828)
+++ trunk/ab5.0/abdev/ab_common/src/ProcessAndModule.cpp	(revision 828)
@@ -0,0 +1,181 @@
+#include "stdafx.h"
+#include "ProcessAndModule.h"
+#include "OSVersion.h"
+
+#include <memory>
+#include <psapi.h>
+#include <tlhelp32.h>
+
+#pragma comment(lib, "psapi.lib")
+
+namespace ActiveBasic { namespace Common {
+
+struct HandleDeleter
+{
+	typedef HANDLE pointer;
+
+	void operator ()(pointer h) const
+	{
+		::CloseHandle(h);
+	}
+};
+
+typedef std::unique_ptr<HANDLE, HandleDeleter> UniqueHandle;
+
+boost::filesystem::path GetModuleFilePath(HANDLE hProcess, HMODULE hmod)
+{	
+	if (GetOSVersion().dwPlatformId == VER_PLATFORM_WIN32_NT)
+	{
+		WCHAR temp[MAX_PATH] = {};
+		if (::GetModuleFileNameExW(hProcess, hmod, temp, MAX_PATH) != 0)
+		{
+			return temp;
+		}
+	}
+	else
+	{
+		CHAR temp[MAX_PATH] = {};
+		if (::GetModuleFileNameA(hmod, temp, MAX_PATH) != 0)
+		{
+			return boost::filesystem::path(Jenga::Common::ToWString(temp));
+		}
+	}
+	throw std::runtime_error("GetModuleFileName or GetModuleFileNameEx failed");
+}
+
+namespace {
+
+struct Toolhelp32Function
+{
+	decltype(::CreateToolhelp32Snapshot)* pCreateToolhelp32Snapshot;
+	decltype(::Process32First)* pProcess32First;
+	decltype(::Process32Next)* pProcess32Next;
+	decltype(::Module32First)* pModule32First;
+	decltype(::Module32Next)* pModule32Next;
+};
+
+Toolhelp32Function const& GetToolhelp32Function(HMODULE hmodKernel)
+{
+	static Toolhelp32Function const tf =
+	{
+		reinterpret_cast<decltype(::CreateToolhelp32Snapshot)*>(::GetProcAddress(hmodKernel, "CreateToolhelp32Snapshot")),
+		reinterpret_cast<decltype(::Process32First)*>(::GetProcAddress(hmodKernel, "Process32First")),
+		reinterpret_cast<decltype(::Process32Next)*>(::GetProcAddress(hmodKernel, "Process32Next")),
+		reinterpret_cast<decltype(::Module32First)*>(::GetProcAddress(hmodKernel, "Module32First")),
+		reinterpret_cast<decltype(::Module32Next)*>(::GetProcAddress(hmodKernel, "Module32Next")),
+	};
+	return tf;
+}
+
+UniqueHandle CreateToolhelp32SnapshotHelper(Toolhelp32Function const& tf, DWORD flags, DWORD processId = 0)
+{
+	UniqueHandle h(tf.pCreateToolhelp32Snapshot(flags, processId));
+	if (h.get() == INVALID_HANDLE_VALUE)
+	{
+		h.release();
+		return UniqueHandle();
+	}
+	return h;
+}
+
+} // unnamed namespace
+
+std::vector<DWORD> GetProcesses()
+{
+	auto const& tf = GetToolhelp32Function(::GetModuleHandle(TEXT("kernel32")));
+	if (tf.pCreateToolhelp32Snapshot)
+	{
+		UniqueHandle h = CreateToolhelp32SnapshotHelper(tf, TH32CS_SNAPPROCESS);
+		if (h == nullptr)
+		{
+			return std::vector<DWORD>();
+		}
+		std::vector<DWORD> processes;
+		PROCESSENTRY32 pe = {sizeof pe};
+		if (tf.pProcess32First(h.get(), &pe))
+		{
+			do
+			{
+				processes.push_back(pe.th32ProcessID);
+			} while (tf.pProcess32Next(h.get(), &pe));
+		}
+		return processes;
+	}
+	else
+	{
+		std::vector<DWORD> processes(8192);
+		DWORD cbNeeded = 0;
+		if (EnumProcesses(processes.data(), processes.size() * sizeof (DWORD), &cbNeeded))
+		{
+			processes.resize(cbNeeded / sizeof (DWORD));
+			return processes;
+		}
+		return std::vector<DWORD>();
+	}
+}
+
+boost::filesystem::path GetExecutableModulePath(DWORD processId)
+{
+	if (ActiveBasic::Common::Is9x())
+	{
+		auto const& tf = GetToolhelp32Function(::GetModuleHandle(TEXT("kernel32")));
+		UniqueHandle h = CreateToolhelp32SnapshotHelper(tf, TH32CS_SNAPMODULE, processId);
+		if (h == nullptr)
+		{
+			return boost::filesystem::path();
+		}
+		MODULEENTRY32 me = {sizeof me};
+		if (tf.pModule32First(h.get(), &me))
+		{
+			return boost::filesystem::path(me.szExePath);
+		}
+		else
+		{
+			return boost::filesystem::path();
+		}
+	}
+	else
+	{
+		UniqueHandle hProcess(::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId));
+		// PSAPIが使える環境はそちらを優先。
+		WCHAR filename[MAX_PATH] = {};
+		::GetModuleFileNameExW(hProcess.get(), nullptr, filename, MAX_PATH);
+		return boost::filesystem::path(filename);
+	}
+}
+
+std::vector<HMODULE> GetModules(DWORD processId)
+{
+	auto const& tf = GetToolhelp32Function(::GetModuleHandle(TEXT("kernel32")));
+	if (tf.pCreateToolhelp32Snapshot)
+	{
+		UniqueHandle h = CreateToolhelp32SnapshotHelper(tf, TH32CS_SNAPMODULE, processId);
+		if (h == nullptr)
+		{
+			return std::vector<HMODULE>();
+		}
+		std::vector<HMODULE> modules;
+		MODULEENTRY32 me = {sizeof me};
+		if (tf.pModule32First(h.get(), &me))
+		{
+			do
+			{
+				modules.push_back(me.hModule);
+			} while (tf.pModule32Next(h.get(), &me));
+		}
+		return modules;
+	}
+	else
+	{
+		UniqueHandle hProcess(::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId));
+		const DWORD MAX_MODULE = 1024;
+		std::vector<HMODULE> module(MAX_MODULE);
+		DWORD cbReturned = 0;
+		EnumProcessModules(hProcess.get(), module.data(), sizeof (HMODULE) * MAX_MODULE, &cbReturned);
+		module.resize(cbReturned / sizeof (HMODULE));
+		return module;
+	}
+}
+
+}}
+
Index: trunk/ab5.0/abdev/ab_common/src/ResourceManager/ResourceManager.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/ResourceManager/ResourceManager.cpp	(revision 773)
+++ trunk/ab5.0/abdev/ab_common/src/ResourceManager/ResourceManager.cpp	(revision 828)
@@ -39,4 +39,9 @@
 
 	std::string baseDir = Jenga::Common::Path::ExtractDirPath( resourceFilePath );
+
+	if (buffer.empty())
+	{
+		return false;
+	}
 
 	i2=0;
