From 8b49d117060160c382656eb74f13981851755317 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 5 Dec 2010 07:46:46 -0700 Subject: [PATCH] win64: mysterx and mzcom --- src/mysterx/bstr.cxx | 24 +- src/mysterx/comtypes.cxx | 4 +- src/mysterx/dotnet/BaseInfo.cpp | 25 - src/mysterx/dotnet/BaseInfo.h | 15 - src/mysterx/dotnet/Patch.cpp | 733 ------------------- src/mysterx/dotnet/Patch.h | 14 - src/mysterx/dotnet/Profiler.cpp | 470 ------------ src/mysterx/dotnet/Profiler.h | 123 ---- src/mysterx/dotnet/ReadMe.txt | 27 - src/mysterx/dotnet/Resource.h | 18 - src/mysterx/dotnet/SList.h | 340 --------- src/mysterx/dotnet/SimpleException.cpp | 30 - src/mysterx/dotnet/SimpleException.h | 13 - src/mysterx/dotnet/Synchronize.cpp | 13 - src/mysterx/dotnet/Synchronize.h | 11 - src/mysterx/dotnet/ThreadInfo.cpp | 34 - src/mysterx/dotnet/ThreadInfo.h | 24 - src/mysterx/dotnet/dotnet.cpp | 10 - src/mysterx/dotnet/dotnet.rc | 99 --- src/mysterx/dotnet/dotnet.rgs | 11 - src/mysterx/dotnet/dotnetps.def | 9 - src/mysterx/dotnet/stdafx.cpp | 11 - src/mysterx/dotnet/stdafx.h | 49 -- src/mysterx/dotnet/utils.cpp | 319 -------- src/mysterx/dotnet/utils.h | 45 -- src/mysterx/htmlutil.cxx | 2 +- src/mysterx/mysterx.cxx | 20 +- src/mzcom/mzobj.cxx | 4 +- src/worksp/README | 31 +- src/worksp/gracket/gracket.sln | 18 + src/worksp/gracket/gracket.vcproj | 180 +++++ src/worksp/libmysterx/.gitignore | 2 + src/worksp/libmysterx/dotnet/dotnet.vcproj | 445 ----------- src/worksp/libmysterx/dotnet/dotnetPS.vcproj | 261 ------- src/worksp/libmysterx/libmysterx.sln | 19 + src/worksp/libmysterx/libmysterx.vcproj | 207 +++++- src/worksp/libmysterx/myspage/myspage.vcproj | 153 +++- src/worksp/libmysterx/myssink/myssink.vcproj | 151 +++- src/worksp/mrstart/mrstart.sln | 3 + src/worksp/mrstart/mrstart.vcproj | 92 +++ src/worksp/mzcom/MzCOM.vcproj | 276 +++++++ src/worksp/mzcom/mzcom.sln | 27 + src/worksp/mzstart/mzstart.sln | 3 + src/worksp/mzstart/mzstart.vcproj | 87 +++ 44 files changed, 1254 insertions(+), 3198 deletions(-) delete mode 100644 src/mysterx/dotnet/BaseInfo.cpp delete mode 100644 src/mysterx/dotnet/BaseInfo.h delete mode 100644 src/mysterx/dotnet/Patch.cpp delete mode 100644 src/mysterx/dotnet/Patch.h delete mode 100644 src/mysterx/dotnet/Profiler.cpp delete mode 100644 src/mysterx/dotnet/Profiler.h delete mode 100644 src/mysterx/dotnet/ReadMe.txt delete mode 100644 src/mysterx/dotnet/Resource.h delete mode 100644 src/mysterx/dotnet/SList.h delete mode 100644 src/mysterx/dotnet/SimpleException.cpp delete mode 100644 src/mysterx/dotnet/SimpleException.h delete mode 100644 src/mysterx/dotnet/Synchronize.cpp delete mode 100644 src/mysterx/dotnet/Synchronize.h delete mode 100644 src/mysterx/dotnet/ThreadInfo.cpp delete mode 100644 src/mysterx/dotnet/ThreadInfo.h delete mode 100644 src/mysterx/dotnet/dotnet.cpp delete mode 100644 src/mysterx/dotnet/dotnet.rc delete mode 100644 src/mysterx/dotnet/dotnet.rgs delete mode 100644 src/mysterx/dotnet/dotnetps.def delete mode 100644 src/mysterx/dotnet/stdafx.cpp delete mode 100644 src/mysterx/dotnet/stdafx.h delete mode 100644 src/mysterx/dotnet/utils.cpp delete mode 100644 src/mysterx/dotnet/utils.h delete mode 100644 src/worksp/libmysterx/dotnet/dotnet.vcproj delete mode 100644 src/worksp/libmysterx/dotnet/dotnetPS.vcproj diff --git a/src/mysterx/bstr.cxx b/src/mysterx/bstr.cxx index a6e620d4d9..eb8d1f89a2 100644 --- a/src/mysterx/bstr.cxx +++ b/src/mysterx/bstr.cxx @@ -21,7 +21,9 @@ static LPWSTR schemeUCS4ToUTF16 (const mzchar * buffer, int nchars, long * result_length) { LPWSTR s; - s = (LPWSTR) scheme_ucs4_to_utf16 (buffer, 0, nchars, NULL, 0, result_length, 1); + intptr_t rl; + s = (LPWSTR) scheme_ucs4_to_utf16 (buffer, 0, nchars, NULL, 0, &rl, 1); + if(result_length) *result_length = rl; s[*result_length] = 0; return s; } @@ -29,7 +31,7 @@ LPWSTR schemeUCS4ToUTF16 (const mzchar * buffer, int nchars, long * result_lengt static LPWSTR schemeUTF8ToUTF16 (const unsigned char * buffer, int buflen, long * result_length) { - long nchars; + intptr_t nchars; mzchar * ucs4; ucs4 = scheme_utf8_decode_to_buffer_len (buffer, buflen, NULL, 0, &nchars); return schemeUCS4ToUTF16 (ucs4, nchars, result_length); @@ -132,7 +134,7 @@ Scheme_Object * multiByteToSchemeCharString (const char * mbstr) int len; WCHAR * wide; HRESULT hr; - long nchars; + intptr_t nchars; mzchar * ucs4; len = (int) strlen (mbstr); @@ -163,7 +165,7 @@ BSTR multiByteToBSTR (LPCSTR text, UINT len) return bstr; } -BSTR textToBSTR (LPCTSTR text, UINT length) +BSTR textToBSTR (LPCTSTR text, size_t length) { #ifdef UNICODE return SysAllocStringLen (text, length); @@ -175,7 +177,7 @@ BSTR textToBSTR (LPCTSTR text, UINT length) Scheme_Object * BSTRToSchemeString (BSTR bstr) { UINT length; - long nchars; + intptr_t nchars; mzchar * string; length = SysStringLen (bstr); @@ -189,7 +191,7 @@ Scheme_Object * BSTRToSchemeString (BSTR bstr) Scheme_Object * LPOLESTRToSchemeString (LPOLESTR str) { UINT length; - long nchars; + intptr_t nchars; mzchar * string; length = wcslen (str); @@ -203,7 +205,7 @@ Scheme_Object * LPOLESTRToSchemeString (LPOLESTR str) Scheme_Object * BSTRToSchemeSymbol (BSTR bstr) { UINT length; - long nchars; + intptr_t nchars; mzchar * string; length = SysStringLen (bstr); @@ -229,9 +231,9 @@ static void updateSchemeByteStringFromBSTR (Scheme_Object * obj, BSTR bstr) { UINT len; - long nchars; + intptr_t nchars; mzchar * string; - long ncodes; + intptr_t ncodes; len = SysStringLen (bstr); string = scheme_utf16_to_ucs4 ((pushort)bstr, 0, len, @@ -250,7 +252,7 @@ static void updateSchemeCharStringFromBSTR (Scheme_Object * obj, BSTR bstr) { UINT len; - long ulen; + intptr_t ulen; len = SysStringLen (bstr); @@ -286,7 +288,7 @@ void updateSchemeFromBSTR (Scheme_Object *obj, BSTR bstr) } -BSTR stringToBSTR (LPCSTR s, UINT len) +BSTR stringToBSTR (LPCSTR s, size_t len) { BSTR bstr; diff --git a/src/mysterx/comtypes.cxx b/src/mysterx/comtypes.cxx index 75b3617a08..95757653b6 100644 --- a/src/mysterx/comtypes.cxx +++ b/src/mysterx/comtypes.cxx @@ -434,13 +434,15 @@ Scheme_Object * mx_scode_to_scheme_number (int argc, Scheme_Object **argv) Scheme_Object * scheme_number_to_mx_scode(int argc, Scheme_Object **argv) { + intptr_t lv; SCODE scode; GUARANTEE_TYPE ("number->com-scode", 0, SCHEME_REALP, "number"); - if (scheme_get_int_val (argv[0], &scode) == 0) + if (scheme_get_int_val (argv[0], &lv) == 0) scheme_signal_error("number->com-scode: " "number %V too big to fit in com-scode", argv[0]); + scode = lv; return mx_make_scode (scode); } diff --git a/src/mysterx/dotnet/BaseInfo.cpp b/src/mysterx/dotnet/BaseInfo.cpp deleted file mode 100644 index 3c33ad667f..0000000000 --- a/src/mysterx/dotnet/BaseInfo.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "StdAfx.h" -#include "baseinfo.h" - -BaseInfo::BaseInfo(UINT_PTR id) -: m_id(id) -, m_isValid(TRUE) -{ - wcscpy (m_name, L"UNKNOWN"); -} - -BaseInfo::~BaseInfo(void) -{ -} - -BOOL BaseInfo::Compare (UINT_PTR key) -{ - return (BOOL)(m_id == key); -} - -void BaseInfo::Dump() -{ - wprintf (L"\n"); - wprintf (L"ID: 0x%08x\n", m_id); - wprintf (L"\n"); -} diff --git a/src/mysterx/dotnet/BaseInfo.h b/src/mysterx/dotnet/BaseInfo.h deleted file mode 100644 index 7278fc0e35..0000000000 --- a/src/mysterx/dotnet/BaseInfo.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -class BaseInfo -{ -public: - BaseInfo(UINT_PTR id); - virtual ~BaseInfo(void); - - virtual void Dump(void); - BOOL Compare(UINT_PTR key); - - UINT_PTR m_id; - BOOL m_isValid; - WCHAR m_name[MAX_LENGTH]; -}; diff --git a/src/mysterx/dotnet/Patch.cpp b/src/mysterx/dotnet/Patch.cpp deleted file mode 100644 index a4a70ce596..0000000000 --- a/src/mysterx/dotnet/Patch.cpp +++ /dev/null @@ -1,733 +0,0 @@ -#include "stdafx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "cordebug.h" -#include "BaseInfo.h" -#include "SimpleException.h" -#include "SList.h" -#include "Synchronize.h" -#include "ThreadInfo.h" -#include "utils.h" - -SList * thread_table; -ICorProfilerInfo * profiler_info; -CRITICAL_SECTION critical_section; - -void InitializePatch (IUnknown * pICorProfilerInfoUnk) -{ - - - HRESULT hr = pICorProfilerInfoUnk->QueryInterface (IID_ICorProfilerInfo, (void **)(&profiler_info)); - - if (SUCCEEDED (hr)) { - - InitializeCriticalSection (&critical_section); - thread_table = new SList(); - profiler_info->SetEventMask (COR_PRF_ENABLE_INPROC_DEBUGGING - | COR_PRF_MONITOR_THREADS - | COR_PRF_MONITOR_CODE_TRANSITIONS - // | COR_PRF_MONITOR_EXCEPTIONS - // | COR_PRF_MONITOR_CLR_EXCEPTIONS - | COR_PRF_MONITOR_JIT_COMPILATION - | COR_PRF_ENABLE_JIT_MAPS); - -#if 0 - hr = profiler_info->SetEnterLeaveFunctionHooks ((FunctionEnter*)&EnterNaked, - (FunctionLeave*)&LeaveNaked, - (FunctionTailcall*)&TailcallNaked); -#endif - show_traceln ("Initializing DotNet synchronization patch."); - show_traceln ("Built at " __TIME__ " on " __DATE__); - } - else - show_traceln ("DotNet synchronization patch failed to initialize."); -} - -void ShutdownPatch (void) -{ - profiler_info->Release(); - if (thread_table != NULL) delete thread_table; - DeleteCriticalSection (&critical_section); -} - -static void _GetThreadInfoHelper (ThreadInfo **ppThreadInfo) -{ - HRESULT hr; - - if (profiler_info != NULL) { - // - // Assume that the thread starts running managed code - // otherwise we would not get notified for its creation - // - (*ppThreadInfo)->m_status = MANAGED; - - // - // Get the win32 threadID for the specific Runtime thread - // - hr = profiler_info->GetThreadInfo ((*ppThreadInfo)->m_id, - &((*ppThreadInfo)->m_win32ThreadID)); - if (SUCCEEDED(hr)) { - // - // Get the thread handle - // - hr = profiler_info->GetHandleFromThread ((*ppThreadInfo)->m_id, - &((*ppThreadInfo)->m_hThread)); - if (FAILED(hr)) - _THROW_EXCEPTION( "ICorProfilerInfo::GetHandleFromThread() FAILED" ); - } - else - _THROW_EXCEPTION( "ICorProfilerInfo::GetThreadInfo() FAILED" ); - } - else - _THROW_EXCEPTION( "ICorProfilerInfo Interface has NOT been Initialized" ); -} - -void AddThread (ThreadID threadID) -{ - Synchronize guard (critical_section); - - HRESULT hr; - ThreadID myThreadID; - - hr = profiler_info->GetCurrentThreadID (&myThreadID); - if (SUCCEEDED (hr)) { - if (threadID == myThreadID) { - ThreadInfo * pThreadInfo; - pThreadInfo = new ThreadInfo (threadID); - if (pThreadInfo != NULL) { - try { - _GetThreadInfoHelper (&pThreadInfo); - thread_table->AddEntry (pThreadInfo, threadID); - pThreadInfo->Dump(); - } - catch (SimpleException *){ - delete pThreadInfo; - throw; - } - } - else - _THROW_EXCEPTION( "Allocation for ThreadInfo Object FAILED" ); - - } - else - _THROW_EXCEPTION( "Thread ID's do not match FAILED" ); - - } - else - _THROW_EXCEPTION( "ICorProfilerInfo::GetCurrentThreadID() FAILED" ); -} - -static void RemoveThread1 (ThreadID threadID) -{ - Synchronize guard (critical_section); - - if (threadID != NULL) { - ThreadInfo *pThreadInfo; - - pThreadInfo = thread_table->Lookup (threadID); - if (pThreadInfo != NULL) { - _ASSERT_ (pThreadInfo->m_isValid == TRUE); - pThreadInfo->m_isValid = FALSE; - pThreadInfo->m_id = 0xbadf00d; - } - else - _THROW_EXCEPTION( "Thread was not found in the Thread Table" ); - } - else - _THROW_EXCEPTION( "ThreadID is NULL" ); -} - -void RemoveThread (ThreadID threadID) -{ - try { - RemoveThread1 (threadID); - show_traceln (".NET thread 0x%x Destroyed", threadID); - } - catch (SimpleException * exception) { - exception->ReportFailure(); - delete exception; - - Failure(); - } - -} - -static ThreadInfo * win32ThreadID_to_ThreadInfo (DWORD win32ThreadId) -{ - if (thread_table->IsEmpty()) { - show_traceln ("win32ThreadId_to_ThreadInfo: table is empty"); - return NULL; - } - - thread_table->Reset(); - - do { - ThreadInfo * this_info = thread_table->Entry(); - if (this_info == NULL) { - show_traceln ("win32ThreadId_to_ThreadInfo: thread not found"); - return NULL; - } - - else if (this_info->m_win32ThreadID == win32ThreadId) { - _ASSERT_ (this_info->m_isValid == TRUE); - return this_info; - } - - else - thread_table->Next(); - } while (true); -} - -static ThreadInfo * current_thread_info() -{ - ThreadInfo * cti = win32ThreadID_to_ThreadInfo (GetCurrentThreadId()); - if (cti == NULL) - show_traceln ("Current thread info not found."); - return cti; -} - -// YOU MUST -// Synchronize guard (critical_section); -// BEFORE CALLING THIS -static ThreadInfo * profiler_info_current_thread_id() -{ - ThreadID threadID; - if (FAILED (profiler_info->GetCurrentThreadID (&threadID))) - _THROW_EXCEPTION ( "ICorProfilerInfo::GetCurrentThreadID() FAILED"); - - ThreadInfo *pThreadInfo = thread_table->Lookup (threadID); - if (pThreadInfo == NULL) - _THROW_EXCEPTION ("Thread Structure was not found in the thread list"); - - _ASSERT_(pThreadInfo->m_isValid == TRUE); - - return pThreadInfo; -} - -void UpdateOSThreadID (ThreadID managedThreadID, DWORD win32ThreadID) -{ - try { - Synchronize guard (critical_section); - profiler_info_current_thread_id()->m_win32ThreadID = win32ThreadID; - show_traceln ("Managed thread 0x%x assigned to OSThread 0x%x"); - } - catch (SimpleException * exception) { - exception->ReportFailure(); - delete exception; - - Failure(); - } -} - -static void UpdateTransitionState (TransitionState state) -{ - try { - Synchronize guard (critical_section); - profiler_info_current_thread_id()->m_status = state; - } - catch (SimpleException * exception) { - exception->ReportFailure(); - delete exception; - Failure(); - } -} - -void NoteThreadManaged (void) -{ - UpdateTransitionState (MANAGED); -} - -void NoteThreadUnmanaged (void) -{ - UpdateTransitionState (UNMANAGED); -} - -static BOOL scan_frame1 (ICorDebugProcess * pProcess, - ULONG32 pnOffset, CorDebugMappingResult mappingResult, - CORDB_ADDRESS code_start, ULONG32 code_size) -{ - bool result = false; - - if (mappingResult == MAPPING_PROLOG) - result = false; - - else if (mappingResult == MAPPING_EPILOG) { - show_trace (" MAPPING_EPILOG"); - result = true; - } - else if (mappingResult == MAPPING_NO_INFO) { - show_trace (" MAPPING_NO_INFO"); - result = false; - } - else if (mappingResult == MAPPING_UNMAPPED_ADDRESS) { - show_trace (" MAPPING_UNMAPPED_ADDRESS"); - result = false; - } - else { - BYTE buffer[1024]; - DWORD realbufsiz; - DWORD bufptr = 0; - - code_start += code_size; - - // align to 4-byte boundary - while ((code_start & 0x3) != 0) code_start += 1; - - if (FAILED (pProcess->ReadMemory (code_start, 1024, buffer, &realbufsiz))) - _THROW_EXCEPTION ("Couldn't get code."); - - if (buffer[0] == 0x01) { - // show_traceln ("EH info follows."); - unsigned char dsize = buffer[1]; - DWORD nclauses = (dsize - 4)/12; - // show_traceln ("%d %d clauses", dsize, nclauses); - unsigned int i; - for (i = 0; i < nclauses; i++) { - DWORD flags = (buffer[(i * 12) + 4 + 1] * 256) + buffer[(i * 12) + 4 + 0]; - DWORD try_offset = (buffer[(i * 12) + 4 + 3] * 256) + buffer[(i * 12) + 4 + 2]; - DWORD try_length = buffer[(i * 12) + 4 + 4]; - DWORD handler_offset = (buffer[(i * 12) + 4 + 6] * 256) + buffer[(i * 12) + 4 + 5]; - DWORD handler_length = buffer[(i * 12) + 4 + 7]; - DWORD class_token = (buffer[(i * 12) + 4 + 9] * 256) + buffer[(i * 12) + 4 + 8]; - DWORD filter_offset = (buffer[(i * 12) + 4 + 11] * 256) + buffer[(i * 12) + 4 + 10]; -// show_traceln ("\tflags (%x)", flags); -// show_traceln ("\ttry_offset (%x)", try_offset); -// show_traceln ("\ttry_length (%x)", try_length); -// show_traceln ("\thandler_offset (%x)", handler_offset); -// show_traceln ("\thandler_length (%x)", handler_length); -// show_traceln ("\tclass_token (%x)", class_token); -// show_traceln ("\tfilter_offset (%x)", filter_offset); - - if (flags == COR_ILEXCEPTION_CLAUSE_FINALLY - && pnOffset >= handler_offset - && pnOffset < (handler_offset + handler_length)) { - show_traceln ("Deferring abort during cleanup."); - result = false; - } - } - } - else if (buffer [0] == 0x41) { - show_traceln ("FAT EH info follows."); - unsigned char dsize = (((buffer[3] * 256) + buffer[2]) * 256) + buffer[1]; - DWORD nclauses = (dsize - 4)/24; - show_trace ("%d %d clauses", dsize, nclauses); - } - else { - // show_traceln ("No EH info."); - result = true; - } - } - return result; -} - -static BOOL GetMethodNameFromTokenAndMetaData (mdToken dwToken, IMetaDataImport * pIMetaDataImport, - LPWSTR wszClass, LPWSTR wszMethod) -{ - wchar_t _wszMethod[512]; - DWORD cchMethod = sizeof (_wszMethod)/sizeof (_wszMethod[0]); - mdTypeDef mdClass; - COR_SIGNATURE const * method_signature; - ULONG sig_size; - DWORD dwAttr; - - HRESULT hr = pIMetaDataImport->GetMethodProps (dwToken, &mdClass, _wszMethod, - cchMethod, &cchMethod, - &dwAttr, - &method_signature, &sig_size, - 0, 0); - - if (FAILED (hr)) { - show_traceln ("GetMethodProps failed."); - return false; - } - - lstrcpyW (wszMethod, _wszMethod); - - wchar_t wszTypeDef[512]; - DWORD cchTypeDef = sizeof(wszTypeDef)/sizeof(wszTypeDef[0]); - - if (mdClass == 0x02000000) - mdClass = 0x02000001; - - hr = pIMetaDataImport->GetTypeDefProps (mdClass, wszTypeDef, cchTypeDef, - &cchTypeDef, 0, 0); - if (FAILED(hr)) return false; - - lstrcpyW (wszClass, wszTypeDef); - return true; -} - -static BOOL GetMethodNameFromFunctionId (FunctionID functionId, LPWSTR wszClass, LPWSTR wszMethod) -{ - mdToken dwToken; - - IMetaDataImport * pMetaDataImport = 0; - if (FAILED (profiler_info->GetTokenAndMetaDataFromFunction (functionId, - IID_IMetaDataImport, - (LPUNKNOWN *)&pMetaDataImport, - &dwToken))) - return false; - - BOOL result = GetMethodNameFromTokenAndMetaData (dwToken, pMetaDataImport, - wszClass, wszMethod); - pMetaDataImport->Release(); - - // - // If we were ambitious, we'd save every FunctionID away in a map to avoid - // needing to hit the metatdata APIs every time. - // - return result; -} - -static BOOL GetMethodNameFromFunction (ICorDebugFunction * pFunction, LPWSTR wszClass, LPWSTR wszMethod) -{ - ICorDebugModule * pModule = NULL; - if (FAILED (pFunction->GetModule (&pModule))) - _THROW_EXCEPTION ("GetModule failed."); - - IMetaDataImport * pMetaDataImport = NULL; - if (FAILED (pModule->GetMetaDataInterface (IID_IMetaDataImport, (IUnknown **)&pMetaDataImport))) - _THROW_EXCEPTION ("GetMetaDataInterface failed."); - - mdMethodDef funToken; - if (FAILED (pFunction->GetToken (&funToken))) - _THROW_EXCEPTION ("GetToken of function failed."); - - BOOL result = GetMethodNameFromTokenAndMetaData (funToken, pMetaDataImport, - wszClass, wszMethod); - - if (pMetaDataImport != NULL) pMetaDataImport->Release(); - if (pModule != NULL) pModule->Release(); - return result; -} - -static void display_method_name (ICorDebugFunction * pFunction) -{ - wchar_t wszClass[512]; - wchar_t wszMethod[512]; - - if (!GetMethodNameFromFunction (pFunction, wszClass, wszMethod)) - _THROW_EXCEPTION ("GetMethodNameFromFunction failed."); - - fwprintf (stderr, wszClass); - show_trace ("::"); - fwprintf (stderr, wszMethod); - fflush (stderr); -} - -// Return TRUE if we can safely call abort. -static BOOL scan_frame (ICorDebugProcess * pProcess, ICorDebugFrame * pFrame) -{ - ICorDebugFunction * pFunction = NULL; - if (FAILED (pFrame->GetFunction (&pFunction))) - _THROW_EXCEPTION ("GetFunction failed."); - - BOOL result = false; - - ULONG32 pnOffset; - CorDebugMappingResult mappingResult; - - ICorDebugILFrame * pILFrame = NULL; - if (FAILED (pFrame->QueryInterface (IID_ICorDebugILFrame, (void **)&pILFrame))) - _THROW_EXCEPTION ("QueryInterface for IID_ICorDebugILFrame failed."); - - if (FAILED (pILFrame->GetIP (&pnOffset, &mappingResult))) - _THROW_EXCEPTION ("GetIP failed."); - if (pILFrame != NULL) pILFrame->Release(); - - // display_method_name (pFunction); - // show_trace (" (%x)", pnOffset); - - ICorDebugCode * pCode = NULL; - if (FAILED (pFunction->GetILCode (&pCode))) - _THROW_EXCEPTION ("GetCode failed."); - - if (pCode == NULL) { - show_traceln ("No code??"); - result = false; - } - else { - CORDB_ADDRESS code_start; - ULONG32 code_size; - - if (FAILED (pCode->GetAddress (&code_start))) - _THROW_EXCEPTION ("GetAddress failed."); - - if (FAILED (pCode->GetSize (&code_size))) - _THROW_EXCEPTION ("GetSize failed."); - - pCode->Release(); - - result = scan_frame1 (pProcess, pnOffset, mappingResult, code_start, code_size); - } - - if (pFunction != NULL) pFunction->Release(); - return result; -} - -// Return TRUE if we can safely call abort. -static BOOL scan_frames (ICorDebugProcess * pProcess, ICorDebugFrame * pFrame) -{ - // Bottom of stack, always safe. - if (pFrame == NULL) - return TRUE; - - // If this frame says no, then no. - else if (!scan_frame (pProcess, pFrame)) - return FALSE; - - // Otherwise, check the next frame. - else { - ICorDebugFrame * pCaller; - if (FAILED (pFrame->GetCaller (&pCaller))) - _THROW_EXCEPTION ("GetCaller failed."); - - BOOL result = scan_frames (pProcess, pCaller); - pCaller->Release(); - return result; - } -} - -static void display_thread_state (ICorDebugThread * pICorDebugThread) -{ - // Check out the state of the thread. - CorDebugThreadState debug_state; - CorDebugUserState user_state; - - if (FAILED (pICorDebugThread->GetDebugState (&debug_state))) - _THROW_EXCEPTION ("GetDebugState failed."); - if (FAILED (pICorDebugThread->GetUserState (&user_state))) - _THROW_EXCEPTION ("GetUserState failed."); - show_traceln ("DS %x, US %x", debug_state, user_state); -} - -// This causes the debugging interface to parse the stack of -// the thread in question. -static void ensure_stack_parsed (ICorDebugThread * pICorDebugThread) -{ - ICorDebugChainEnum * pChains = NULL; - - if (FAILED (pICorDebugThread->EnumerateChains (&pChains))) - _THROW_EXCEPTION ("EnumerateChains failed."); - - if (pChains != NULL) pChains->Release(); -} - -static BOOL BeforeAbort1 (HANDLE thread_handle, int threadID) -{ - // Get a hold of the debugger to start examining thread. - BOOL result = false; - - ThreadInfo * target_thread_info = win32ThreadID_to_ThreadInfo (threadID); - - if (target_thread_info == NULL) { - show_traceln ("Could not find target thread info."); - return true; - } - else if (target_thread_info->m_status != MANAGED) { - show_traceln ("Abort deferred (thread not in MANAGED state)."); - return false; - } - else if (target_thread_info->abort_deferred == TRUE) { - show_traceln ("Abort deferred."); - return false; - } - else if (target_thread_info->throw_depth != 0) { - show_traceln ("Abort deferred, target thread throwing."); - return false; - } - - IUnknown * pIUnknown = NULL; - if (FAILED (profiler_info->GetInprocInspectionInterface (&pIUnknown))) - _THROW_EXCEPTION ("GetInprocInspectionInterface failed."); - - ICorDebug * pICorDebug = NULL; - if (FAILED (pIUnknown->QueryInterface (IID_ICorDebug, (void **)&pICorDebug))) - _THROW_EXCEPTION ("QueryInterface IID_ICorDebug failed."); - - if (pIUnknown != NULL) pIUnknown->Release(); - - ICorDebugProcess * pICorDebugProcess = NULL; - if (FAILED (pICorDebug->GetProcess (GetCurrentProcessId(), &pICorDebugProcess))) - _THROW_EXCEPTION ("GetProcess failed."); - - ICorDebugThread * pICorDebugThread = NULL; - if (FAILED (pICorDebugProcess->GetThread (threadID, &pICorDebugThread))) - _THROW_EXCEPTION ("GetThread failed."); - - // display_thread_state (pICorDebugThread); - ensure_stack_parsed (pICorDebugThread); - - ICorDebugFrame * pFrame = NULL; - if (FAILED (pICorDebugThread->GetActiveFrame (&pFrame))) - _THROW_EXCEPTION ("GetActiveFrame failed."); - - result = scan_frames (pICorDebugProcess, pFrame); - - if (pFrame != NULL) pFrame->Release(); - if (pICorDebugThread != NULL) pICorDebugThread->Release(); - if (pICorDebugProcess != NULL) pICorDebugProcess->Release(); - if (pICorDebug != NULL) pICorDebug->Release(); - - if (pFrame != NULL && result == TRUE) - SuspendThread (thread_handle); - - return result; -} - -// Return TRUE if we can safely call abort. -BOOL __stdcall BeforeAbort (int threadID) -{ - // Must grab this first in case target thread wants to use it. - Synchronize guard (critical_section); - HANDLE thread_handle = OpenThread (THREAD_SUSPEND_RESUME, false, threadID); - - if (thread_handle == NULL) - return false; - - DWORD dwProfContext; - - // BeginInprocDebugging interface first to halt all the threads. - if (FAILED (profiler_info->BeginInprocDebugging (false, &dwProfContext))) - _THROW_EXCEPTION ("BeginInprocDebugging failed."); - - BOOL result = BeforeAbort1 (thread_handle, threadID); - - if (FAILED (profiler_info->EndInprocDebugging (dwProfContext))) - _THROW_EXCEPTION ("EndInprocDebugging failed."); - - if (thread_handle != NULL) CloseHandle (thread_handle); - return result; -} - -void __stdcall AfterAbort (int threadID) -{ - HANDLE thread_handle = OpenThread (THREAD_SUSPEND_RESUME, false, threadID); - if (thread_handle == NULL) - show_traceln ("Could not open windows thread %d.", threadID); - else { - ResumeThread (thread_handle); - CloseHandle (thread_handle); - } - return; -} - -void PatchJIT (FunctionID functionID) -{ - - wchar_t wszClass[512]; - wchar_t wszMethod[512]; - - if (GetMethodNameFromFunctionId (functionID, wszClass, wszMethod)) { - if (wcscmp (wszClass, L"System.Threading.Thread") == 0 - && wcscmp (wszMethod, L"Abort") == 0) { - - ClassID classId = 0; - ModuleID moduleId = 0; - mdToken tkMethod = 0; - IMetaDataEmit* pMetaDataEmit = NULL; - IMethodMalloc* pMalloc = NULL; - PVOID pMethod; - - if (FAILED (profiler_info->GetFunctionInfo (functionID, &classId, &moduleId, &tkMethod))) - _THROW_EXCEPTION ("GetFunctionInfo failed."); - - if (FAILED (profiler_info->GetModuleMetaData (moduleId, ofRead | ofWrite, IID_IMetaDataEmit, - (IUnknown **)&pMetaDataEmit))) - _THROW_EXCEPTION ("GetModuleMetaData failed."); - - // Get token of System.Threading.Thread - mdTypeRef tkThread = get_type_token (pMetaDataEmit, - L"mscorlib", 1, 1, 5000, 0, - 0xB7, 0x7A, 0x5C, 0x56, 0x19, 0x34, 0xE0, 0x89, - L"System.Threading.Thread"); - - // Get token of SchemeBridge.TestClass - mdTypeRef tkTestClass = get_type_token (pMetaDataEmit, - L"bridge", 1, 0, 0, 0, - 0x64, 0x52, 0x72, 0x4b, 0xac, 0x30, 0xf0, 0xec, - L"SchemeBridge.TestClass"); - -// This is the chunk of .NET opcodes that we're replacing -// the existing Thread.Abort method with. - -#pragma pack(push, 1) - struct { - unsigned char Flags_CodeSize; - unsigned char bs0; unsigned char target0; - unsigned char ldc1; - unsigned char call0; int sig0; - unsigned char ldarg0_0; - unsigned char call2; int sig2; - unsigned char ldci4_1; int val_1; - unsigned char calli; int sig; - unsigned char brf; unsigned char target1; - unsigned char ldarg0_1; - unsigned char ldfld; int field0; - unsigned char call1; int target2; - unsigned char ldarg0_2; - unsigned char call3; int sig3; - unsigned char ldci4_2; int val_2; - unsigned char calli_1; int sig_1; - unsigned char ret; unsigned char pad1, pad2, pad3; - } ilcode = { - 0xDA, - 0x2B, 0x06, - 0x16, - 0x28, signature_one_arg (pMetaDataEmit, - tkThread, - L"Sleep", - IMAGE_CEE_CS_CALLCONV_DEFAULT, - ELEMENT_TYPE_VOID, - ELEMENT_TYPE_I4), - 0x02, - 0x28, signature_one_arg (pMetaDataEmit, - tkTestClass, - L"GetThreadId", - IMAGE_CEE_CS_CALLCONV_DEFAULT, - ELEMENT_TYPE_I4, - ELEMENT_TYPE_OBJECT), - 0x20, (int)(size_t)BeforeAbort, - 0x29, signature_unmanaged_one_arg (pMetaDataEmit, - IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL, - ELEMENT_TYPE_BOOLEAN, - ELEMENT_TYPE_U4), - 0x2C, 0xE8, - 0x02, - 0x00, (int)0x0000, - 0x28, signature_no_args (pMetaDataEmit, - tkThread, - L"AbortInternal", - IMAGE_CEE_CS_CALLCONV_HASTHIS, - ELEMENT_TYPE_VOID), - 0x02, - 0x28, signature_one_arg (pMetaDataEmit, - tkTestClass, - L"GetThreadId", - IMAGE_CEE_CS_CALLCONV_DEFAULT, - ELEMENT_TYPE_I4, - ELEMENT_TYPE_OBJECT), - 0x20, (int)(size_t)AfterAbort, - 0x29, signature_unmanaged_one_arg (pMetaDataEmit, - IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL, - ELEMENT_TYPE_VOID, - ELEMENT_TYPE_U4), - 0x2A, 0x00, 0x00, 0x00 - }; -#pragma pack(pop) - - profiler_info->GetILFunctionBodyAllocator (moduleId, &pMalloc); - pMethod = pMalloc->Alloc (sizeof (ilcode)); - memcpy (pMethod, &ilcode, sizeof (ilcode)); - profiler_info->SetILFunctionBody (moduleId, tkMethod, (LPCBYTE)pMethod); - pMalloc->Release(); - pMetaDataEmit->Release(); - show_traceln ("Replaced the code for abort."); - } - - // show_traceln ("Compiling %ls::%ls", wszClass, wszMethod); - } -} diff --git a/src/mysterx/dotnet/Patch.h b/src/mysterx/dotnet/Patch.h deleted file mode 100644 index aa016df432..0000000000 --- a/src/mysterx/dotnet/Patch.h +++ /dev/null @@ -1,14 +0,0 @@ -// Some random globals. - -void InitializePatch (IUnknown * pICorProfilerInfoUnk); -void ShutdownPatch(void); -void AddThread (ThreadID threadID); -void RemoveThread (ThreadID threadID); -void UpdateOSThreadID (ThreadID managedThreadID, DWORD win32ThreadID); -void PatchJIT (FunctionID functionID); -void NoteThreadManaged(void); -void NoteThreadUnmanaged(void); - - - - diff --git a/src/mysterx/dotnet/Profiler.cpp b/src/mysterx/dotnet/Profiler.cpp deleted file mode 100644 index bf0ff674f3..0000000000 --- a/src/mysterx/dotnet/Profiler.cpp +++ /dev/null @@ -1,470 +0,0 @@ -// Profiler.cpp : Implementation of CProfiler - -#include "stdafx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "Patch.h" -#include "Profiler.h" -#include "utils.h" - -// the header file declares the types wrong -void __stdcall enter_function (FunctionID) -{ - return; -} - -void __stdcall leave_function (FunctionID) -{ - return; -} - -void __stdcall tailcall_function (FunctionID) -{ - return; -} - -void __declspec (naked) EnterNaked() -{ - __asm { - push eax - push ecx - push edx - push [esp+16] - call enter_function - pop edx - pop ecx - pop eax - ret 4 - } -} - - -void __declspec (naked) LeaveNaked() -{ - __asm { - push eax - push ecx - push edx - push [esp+16] - call leave_function - pop edx - pop ecx - pop eax - ret 4 - } -} - - -void __declspec (naked) TailcallNaked() -{ - __asm { - push eax - push ecx - push edx - push [esp+16] - call tailcall_function - pop edx - pop ecx - pop eax - ret 4 - } -} - -// CProfiler - -STDMETHODIMP CProfiler::Initialize (IUnknown* pICorProfilerInfoUnk) -{ - // cannot use inproc debugging in this method - - // We're going to hang around for a while. - this->AddRef(); - InitializePatch(pICorProfilerInfoUnk); - return S_OK; -} - -STDMETHODIMP CProfiler::Shutdown () -{ - // cannot use inproc debugging in this method - ShutdownPatch(); - this->Release(); - return S_OK; -} - -STDMETHODIMP CProfiler::AppDomainCreationStarted (AppDomainID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AppDomainCreationFinished (AppDomainID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AppDomainShutdownStarted (AppDomainID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AppDomainShutdownFinished (AppDomainID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AssemblyLoadStarted (AssemblyID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AssemblyLoadFinished (AssemblyID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AssemblyUnloadStarted (AssemblyID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::AssemblyUnloadFinished (AssemblyID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ModuleLoadStarted (ModuleID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ModuleLoadFinished (ModuleID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ModuleUnloadStarted (ModuleID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ModuleUnloadFinished (ModuleID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ModuleAttachedToAssembly (ModuleID,AssemblyID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ClassLoadStarted (ClassID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ClassLoadFinished (ClassID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ClassUnloadStarted (ClassID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ClassUnloadFinished (ClassID,HRESULT) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::FunctionUnloadStarted (FunctionID) -{ - return S_OK; -} - -// Do you *really* want to know what this is doing? -// It is hooking the JIT compiler so that when the Thread.Abort method -// is compiled it is replaced with a working version of same. -// Insane. - -STDMETHODIMP CProfiler::JITCompilationStarted (FunctionID functionID, BOOL) -{ - PatchJIT (functionID); - return S_OK; -} - -STDMETHODIMP CProfiler::JITCompilationFinished (FunctionID, HRESULT, BOOL) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::JITCachedFunctionSearchStarted (FunctionID, BOOL*) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::JITCachedFunctionSearchFinished (FunctionID, COR_PRF_JIT_CACHE) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::JITFunctionPitched (FunctionID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::JITInlining (FunctionID, FunctionID, BOOL*) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ThreadCreated (ThreadID threadID) -{ - // cannot use inproc debugging in this method - AddThread (threadID); - show_traceln (".NET thread 0x%x created.", threadID); - return S_OK; -} - -STDMETHODIMP CProfiler::ThreadDestroyed (ThreadID threadID) -{ - RemoveThread (threadID); - return S_OK; -} - -STDMETHODIMP CProfiler::ThreadAssignedToOSThread (ThreadID managedThreadID, DWORD osThreadID) -{ - UpdateOSThreadID (managedThreadID, osThreadID); - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingClientInvocationStarted() -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingClientSendingMessage (GUID*, BOOL) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingClientReceivingReply (GUID*, BOOL) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingClientInvocationFinished() -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingServerReceivingMessage (GUID*, BOOL) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingServerInvocationStarted() -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingServerInvocationReturned() -{ - return S_OK; -} - -STDMETHODIMP CProfiler::RemotingServerSendingReply (GUID*, BOOL) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::UnmanagedToManagedTransition (FunctionID functionID, COR_PRF_TRANSITION_REASON reason) -{ - NoteThreadManaged(); - return S_OK; -} - -STDMETHODIMP CProfiler::ManagedToUnmanagedTransition (FunctionID functionID, COR_PRF_TRANSITION_REASON reason) -{ - NoteThreadUnmanaged(); - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeSuspendStarted (COR_PRF_SUSPEND_REASON) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeSuspendFinished () -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeSuspendAborted () -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeResumeStarted () -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeResumeFinished () -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeThreadSuspended (ThreadID) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RuntimeThreadResumed (ThreadID) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::MovedReferences (ULONG, ObjectID[], ObjectID[], ULONG[]) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::ObjectAllocated (ObjectID, ClassID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ObjectsAllocatedByClass (ULONG, ClassID[], ULONG[]) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::ObjectReferences (ObjectID, ClassID, ULONG, ObjectID[]) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::RootReferences (ULONG, ObjectID[]) -{ - // cannot use inproc debugging in this method - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionThrown (ObjectID) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionSearchFunctionEnter (FunctionID) -{ - show_traceln ("Exception Search Function Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionSearchFunctionLeave () -{ - show_traceln ("Exception Search Function Leave"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionSearchFilterEnter (FunctionID) -{ - show_traceln ("Exception Search Filter Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionSearchFilterLeave () -{ - show_traceln ("Exception Search Filter Leave"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionSearchCatcherFound (FunctionID) -{ - show_traceln ("Exception Search Catcher Found"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionOSHandlerEnter (UINT_PTR) -{ - // cannot use inproc debugging in this method - show_traceln ("Exception OS Handler Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionOSHandlerLeave (UINT_PTR) -{ - // cannot use inproc debugging in this method - show_traceln ("Exception OS Handler Leave"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionUnwindFunctionEnter (FunctionID) -{ - show_traceln ("Exception Unwind Function Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionUnwindFunctionLeave() -{ - show_traceln ("Exception Unwind Function Leave"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionUnwindFinallyEnter (FunctionID) -{ - show_traceln ("Exception Unwind Finally Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionUnwindFinallyLeave() -{ - show_traceln ("Exception Unwind Finally Leave"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionCatcherEnter (FunctionID, ObjectID) -{ - show_traceln ("Exception Catcher Enter"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionCatcherLeave() -{ - return S_OK; -} - -STDMETHODIMP CProfiler::COMClassicVTableCreated (ClassID, REFGUID, void *, ULONG) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::COMClassicVTableDestroyed (ClassID, REFGUID, void *) -{ - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionCLRCatcherFound() -{ - // cannot use inproc debugging in this method - show_traceln ("Exception CLR Catcher Found"); - return S_OK; -} - -STDMETHODIMP CProfiler::ExceptionCLRCatcherExecute() -{ - // cannot use inproc debugging in this method - return S_OK; -} diff --git a/src/mysterx/dotnet/Profiler.h b/src/mysterx/dotnet/Profiler.h deleted file mode 100644 index 07a98cb8ec..0000000000 --- a/src/mysterx/dotnet/Profiler.h +++ /dev/null @@ -1,123 +0,0 @@ -// Profiler.h : Declaration of the CProfiler - -#pragma once -#include "resource.h" // main symbols - -// IProfiler -[ - object, - uuid("83D97963-F095-4B79-93CD-654785404021"), - dual, helpstring("IProfiler Interface"), - pointer_default(unique) -] -__interface IProfiler : IDispatch -{ -}; - - - -// CProfiler - -[ - coclass, - threading("single"), - aggregatable("never"), - vi_progid("MysterX.DotnetProfiler"), - progid("MysterX.DotnetProfiler.1"), - version(1.0), - uuid("00CAE45B-E089-4EB1-AA4B-0AB5C74932F8"), - helpstring("Profiler Class") -] -class ATL_NO_VTABLE CProfiler : - public IProfiler, - public ICorProfilerCallback -{ -public: - CProfiler() - { - } - - - DECLARE_PROTECT_FINAL_CONSTRUCT() - - HRESULT FinalConstruct() - { - return S_OK; - } - - void FinalRelease() - { - } - -public: - STDMETHOD(Initialize)(IUnknown*); - STDMETHOD(Shutdown)(); - STDMETHOD(AppDomainCreationStarted)(AppDomainID); - STDMETHOD(AppDomainCreationFinished)(AppDomainID,HRESULT); - STDMETHOD(AppDomainShutdownStarted)(AppDomainID); - STDMETHOD(AppDomainShutdownFinished)(AppDomainID,HRESULT); - STDMETHOD(AssemblyLoadStarted)(AssemblyID); - STDMETHOD(AssemblyLoadFinished)(AssemblyID,HRESULT); - STDMETHOD(AssemblyUnloadStarted)(AssemblyID); - STDMETHOD(AssemblyUnloadFinished)(AssemblyID,HRESULT); - STDMETHOD(ModuleLoadStarted)(ModuleID); - STDMETHOD(ModuleLoadFinished)(ModuleID,HRESULT); - STDMETHOD(ModuleUnloadStarted)(ModuleID); - STDMETHOD(ModuleUnloadFinished)(ModuleID,HRESULT); - STDMETHOD(ModuleAttachedToAssembly)(ModuleID,AssemblyID); - STDMETHOD(ClassLoadStarted)(ClassID); - STDMETHOD(ClassLoadFinished)(ClassID,HRESULT); - STDMETHOD(ClassUnloadStarted)(ClassID); - STDMETHOD(ClassUnloadFinished)(ClassID,HRESULT); - STDMETHOD(FunctionUnloadStarted)(FunctionID); - STDMETHOD(JITCompilationStarted)(FunctionID,BOOL); - STDMETHOD(JITCompilationFinished)(FunctionID,HRESULT,BOOL); - STDMETHOD(JITCachedFunctionSearchStarted)(FunctionID,BOOL*); - STDMETHOD(JITCachedFunctionSearchFinished)(FunctionID,COR_PRF_JIT_CACHE); - STDMETHOD(JITFunctionPitched)(FunctionID); - STDMETHOD(JITInlining)(FunctionID,FunctionID,BOOL*); - STDMETHOD(ThreadCreated)(ThreadID); - STDMETHOD(ThreadDestroyed)(ThreadID); - STDMETHOD(ThreadAssignedToOSThread)(ThreadID,DWORD); - STDMETHOD(RemotingClientInvocationStarted)(); - STDMETHOD(RemotingClientSendingMessage)(GUID*,BOOL); - STDMETHOD(RemotingClientReceivingReply)(GUID*,BOOL); - STDMETHOD(RemotingClientInvocationFinished)(); - STDMETHOD(RemotingServerReceivingMessage)(GUID*,BOOL); - STDMETHOD(RemotingServerInvocationStarted)(); - STDMETHOD(RemotingServerInvocationReturned)(); - STDMETHOD(RemotingServerSendingReply)(GUID*,BOOL); - STDMETHOD(UnmanagedToManagedTransition)(FunctionID,COR_PRF_TRANSITION_REASON); - STDMETHOD(ManagedToUnmanagedTransition)(FunctionID,COR_PRF_TRANSITION_REASON); - STDMETHOD(RuntimeSuspendStarted)(COR_PRF_SUSPEND_REASON); - STDMETHOD(RuntimeSuspendFinished)(); - STDMETHOD(RuntimeSuspendAborted)(); - STDMETHOD(RuntimeResumeStarted)(); - STDMETHOD(RuntimeResumeFinished)(); - STDMETHOD(RuntimeThreadSuspended)(ThreadID); - STDMETHOD(RuntimeThreadResumed)(ThreadID); - STDMETHOD(MovedReferences)(ULONG,ObjectID[],ObjectID[],ULONG[]); - STDMETHOD(ObjectAllocated)(ObjectID,ClassID); - STDMETHOD(ObjectsAllocatedByClass)(ULONG,ClassID[],ULONG[]); - STDMETHOD(ObjectReferences)(ObjectID,ClassID,ULONG,ObjectID[]); - STDMETHOD(RootReferences)(ULONG,ObjectID[]); - STDMETHOD(ExceptionThrown)(ObjectID); - STDMETHOD(ExceptionSearchFunctionEnter)(FunctionID); - STDMETHOD(ExceptionSearchFunctionLeave)(); - STDMETHOD(ExceptionSearchFilterEnter)(FunctionID); - STDMETHOD(ExceptionSearchFilterLeave)(); - STDMETHOD(ExceptionSearchCatcherFound)(FunctionID); - STDMETHOD(ExceptionOSHandlerEnter)(UINT_PTR); - STDMETHOD(ExceptionOSHandlerLeave)(UINT_PTR); - STDMETHOD(ExceptionUnwindFunctionEnter)(FunctionID); - STDMETHOD(ExceptionUnwindFunctionLeave)(); - STDMETHOD(ExceptionUnwindFinallyEnter)(FunctionID); - STDMETHOD(ExceptionUnwindFinallyLeave)(); - STDMETHOD(ExceptionCatcherEnter)(FunctionID,ObjectID); - STDMETHOD(ExceptionCatcherLeave)(); - STDMETHOD(COMClassicVTableCreated)(ClassID,REFGUID,void*,ULONG); - STDMETHOD(COMClassicVTableDestroyed)(ClassID,REFGUID,void*); - STDMETHOD(ExceptionCLRCatcherFound)(); - STDMETHOD(ExceptionCLRCatcherExecute)(); -}; - diff --git a/src/mysterx/dotnet/ReadMe.txt b/src/mysterx/dotnet/ReadMe.txt deleted file mode 100644 index ab71fb1028..0000000000 --- a/src/mysterx/dotnet/ReadMe.txt +++ /dev/null @@ -1,27 +0,0 @@ -This directory contains an important bug fix for the .NET engine. - -For details about the build process, see `overview.txt' within this -directory. - -The .NET engine has a race condition within the thread library. This -directory contains the code that eliminates the race condition. This -library pretends to be a profiler for the .NET runtime. It intercepts -thread activity and compilation activity through profiling hooks -provided by the .NET runtime. It tracks the threads as they enter and -leave the CLR, and patches the JIT compiler to add special code around -the Thread.Abort() method. - -To use this code, the environment variable `Cor_Enable_Profiling' must -be set to "1", and the environment variable `Cor_Profiler' must be set -to "MysterX.DotnetProfiler" before starting the CLR. (They may be set -by calling the Racket function putenv.) - -If correctly set, a message like the following will be printed when -the CLR is started: - - Initializing DotNet synchronization patch. - Built at 13:56:09 on Jul 17 2003 - -This message will not be printed if the environment variables are not -set, or if the dotnet module is not compiled and registered properly. - diff --git a/src/mysterx/dotnet/Resource.h b/src/mysterx/dotnet/Resource.h deleted file mode 100644 index a3e039e8c3..0000000000 --- a/src/mysterx/dotnet/Resource.h +++ /dev/null @@ -1,18 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by dotnet.rc -// - -#define IDS_PROJNAME 100 -#define IDR_DOTNET 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_COMMAND_VALUE 32768 -#define _APS_NEXT_CONTROL_VALUE 201 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/src/mysterx/dotnet/SList.h b/src/mysterx/dotnet/SList.h deleted file mode 100644 index bccdf67fe3..0000000000 --- a/src/mysterx/dotnet/SList.h +++ /dev/null @@ -1,340 +0,0 @@ -template class SList; - -template -class SListNode -{ - friend class SList; - - public: - - SListNode( T entry, K Key ); - virtual ~SListNode(); - - - private: - - K m_key; - T m_pEntry; - - SListNode *m_pNext; - -}; // SListNode - - -/* public */ -template -SListNode::SListNode ( T entry, K key ) - : m_key (key), - m_pNext (NULL), - m_pEntry (entry) -{ -} // ctor - -/* public */ -template -SListNode::~SListNode() -{ - if (m_pEntry != NULL) { - delete m_pEntry; - m_pEntry = NULL; - } - -} // dtor - -template -class SList -{ - public: - - SList(); - virtual ~SList(); - - SList( const SList &source ); - SList &operator=( const SList &source ); - - - public: - - void Dump(); - - BOOL IsEmpty(); - T Lookup( K key ); - void DelEntry( K key ); - void AddEntry( T entry, K key ); - - // - // getters - // - T Head(); - T Tail(); - T Entry(); - ULONG Count(); - - // - // intrinsic iteration - // - void Next(); - void Reset(); - BOOL AtEnd(); - BOOL AtStart(); - - - private: - - ULONG m_count; - - SListNode *m_pHead; - SListNode *m_pTail; - SListNode *m_pCursor; - - CRITICAL_SECTION m_criticalSection; - -}; // SList - -/* public */ -template -SList::SList() - : m_count (0), - m_pHead (NULL), - m_pTail (NULL), - m_pCursor (NULL) -{ - InitializeCriticalSection (&m_criticalSection); -} // ctor - -/* public */ -template -SList::~SList() -{ - if (m_pHead != NULL) { - Synchronize guard (m_criticalSection); - - SListNode *cursor = m_pHead; - - // delete all entries - m_count = 0; - for (; ((m_pHead = m_pHead->m_pNext) != NULL); cursor = m_pHead) - delete cursor; - delete cursor; - } - - DeleteCriticalSection (&m_criticalSection); -} // dtor - -/* public */ -template -SList &SList::operator= (const SList &source) -{ - Synchronize guard (m_criticalSection); - - memcpy (this, &source, sizeof (SList)); - - return *this; - -} // assignment operator - -/* public */ -template -SList::SList (const SList &source) -{ - Synchronize guard (m_criticalSection); - - m_pHead = source.m_pHead; - m_pTail = source.m_pTail; -} // copy ctor - -/* public */ -template -void SList::Dump() -{ - Synchronize guard (m_criticalSection); - - SListNode *cursor = m_pHead; - - for (; (cursor != NULL); cursor = cursor->m_pNext) - cursor->m_pEntry->Dump(); - -} // SList::Dump - -/* public */ -template -ULONG SList::Count() -{ - Synchronize guard (m_criticalSection); - return m_count; - -} // SList::Count - -/* public */ -template -void SList::AddEntry (T entry, K key) -{ - Synchronize guard (m_criticalSection); - - ++m_count; - SListNode * temp = new SListNode (entry, key); - - // list insertion implies appending to the end of the list - if (m_pHead == NULL) - m_pHead = temp; - - else - m_pTail->m_pNext = temp; - - m_pCursor = m_pTail = temp; - -} // SList::AddEntry - -/* public */ -template -void SList::DelEntry (K key) -{ - - Synchronize guard (m_criticalSection); - - if (m_pHead != NULL) { - - SListNode *cursor = m_pHead; - - // - // Case 1: delete head entry - // - if (m_pHead->m_pEntry->Compare (key) == TRUE) { - --m_count; - - // consider case where head == tail - if ((m_pHead = m_pHead->m_pNext) == NULL) - m_pCursor = m_pTail = m_pHead; - - else - m_pCursor = m_pHead; - - - delete cursor; - cursor = NULL; - } - // - // Case 2: delete inner entry - // - else { - SListNode *precursor = cursor; - - - // scan for match - for (; ((cursor = cursor->m_pNext) != NULL); precursor = cursor) { - if (cursor->m_pEntry->Compare( key ) == TRUE) { - --m_count; - m_pCursor = precursor; - precursor->m_pNext = cursor->m_pNext; - - // consider case where deleted entry is the tail - if (m_pTail == cursor) { - m_pTail = precursor; - m_pTail->m_pNext = NULL; - } - - delete cursor; - cursor = NULL; - break; - } - - } // for - } - } -} // SList::DelEntry - - -/* public */ -template -T SList::Lookup (K key) -{ - Synchronize guard (m_criticalSection); - - SListNode *cursor = m_pHead; - - // scan for match - for ( ; - ((cursor != NULL) && (cursor->m_pEntry->Compare (key) == FALSE)); - cursor = cursor->m_pNext ) - ; // continue - - - return ((cursor != NULL) ? cursor->m_pEntry : NULL); -} // SList::Lookup - -/* public */ -template -T SList::Entry() -{ - Synchronize guard (m_criticalSection); - - return ((m_pCursor != NULL) ? m_pCursor->m_pEntry : NULL); - -} // SList::Entry - -/* public */ -template -T SList::Head() -{ - Synchronize guard (m_criticalSection); - - return ((m_pHead != NULL) ? m_pHead->m_pEntry : NULL); -} // SList::Head - -/* public */ -template -T SList::Tail() -{ - Synchronize guard (m_criticalSection); - - return ((m_pTail != NULL) ? m_pTail->m_pEntry : NULL); - -} // SList::Tail - -/* public */ -template -void SList::Next() -{ - Synchronize guard (m_criticalSection); - - if (m_pCursor != NULL) - m_pCursor = m_pCursor->m_pNext; - -} // SList::Next() - -/* public */ -template -void SList::Reset() -{ - Synchronize guard (m_criticalSection); - - m_pCursor = m_pHead; - -} // SList::Reset - -/* public */ -template -BOOL SList::AtEnd() -{ - Synchronize guard (m_criticalSection); - - return (BOOL)(m_pCursor == NULL); -} // SList::AtEnd - -/* public */ -template -BOOL SList::AtStart() -{ - Synchronize guard (m_criticalSection); - - return (BOOL)(m_pCursor == m_pHead); -} // SList::AtStart - -/* public */ -template -BOOL SList::IsEmpty() -{ - Synchronize guard (m_criticalSection); - - return (BOOL)(m_pHead == NULL); -} // SList::IsEmpty diff --git a/src/mysterx/dotnet/SimpleException.cpp b/src/mysterx/dotnet/SimpleException.cpp deleted file mode 100644 index 251d904add..0000000000 --- a/src/mysterx/dotnet/SimpleException.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "StdAfx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "cordebug.h" -#include "threadinfo.h" -#include "SimpleException.h" -#include "utils.h" - -SimpleException::SimpleException(const char * reason) -: m_reason(NULL) -{ - SIZE_T length = strlen (reason); - - m_reason = new char[(length + 1)]; - strcpy (m_reason, reason); -} - -SimpleException::~SimpleException(void) -{ - if (m_reason != NULL) - delete [] m_reason; -} - -void SimpleException::ReportFailure(void) -{ - TEXT_OUTLN (m_reason); -} diff --git a/src/mysterx/dotnet/SimpleException.h b/src/mysterx/dotnet/SimpleException.h deleted file mode 100644 index 231b9e1ddf..0000000000 --- a/src/mysterx/dotnet/SimpleException.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -class SimpleException -{ -public: - SimpleException(const char * reason); - virtual ~SimpleException(void); -private: - // Why the exception was thrown. - char *m_reason; -public: - virtual void ReportFailure(void); -}; diff --git a/src/mysterx/dotnet/Synchronize.cpp b/src/mysterx/dotnet/Synchronize.cpp deleted file mode 100644 index 3d38678ae2..0000000000 --- a/src/mysterx/dotnet/Synchronize.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "StdAfx.h" -#include "synchronize.h" - -Synchronize::Synchronize(CRITICAL_SECTION &criticalSection) - : m_block (criticalSection) -{ - EnterCriticalSection (&m_block); -} - -Synchronize::~Synchronize(void) -{ - LeaveCriticalSection (&m_block); -} diff --git a/src/mysterx/dotnet/Synchronize.h b/src/mysterx/dotnet/Synchronize.h deleted file mode 100644 index 53cb6b735a..0000000000 --- a/src/mysterx/dotnet/Synchronize.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -class Synchronize -{ -public: - Synchronize(CRITICAL_SECTION &criticalSection); - ~Synchronize(void); -private: - // Cheesy unwind-protect in C++. - CRITICAL_SECTION m_block; -}; diff --git a/src/mysterx/dotnet/ThreadInfo.cpp b/src/mysterx/dotnet/ThreadInfo.cpp deleted file mode 100644 index 4a7439162c..0000000000 --- a/src/mysterx/dotnet/ThreadInfo.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "StdAfx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "cordebug.h" -#include "threadinfo.h" - -ThreadInfo::ThreadInfo(ThreadID threadID) : - BaseInfo (threadID) - , m_originalTID(threadID) - , m_hThread(NULL) - , m_status (UNINITIALIZED) - , m_win32ThreadID(0) - , throw_depth(0) - , abort_deferred(FALSE) - { - wcscpy (m_name, L"THREAD"); -} - -ThreadInfo::~ThreadInfo(void) -{ -} - -void ThreadInfo::Dump() -{ - fwprintf (stderr, L"\n" ); - fwprintf (stderr, L"THREAD ID: 0x%08x (%d)\n", m_id, m_id); - fwprintf (stderr, L"\tHANDLE: 0x%08x (%d)\n", m_hThread, m_hThread); - fwprintf (stderr, L"\tWIN32 ID: 0x%08x (%d)\n", m_win32ThreadID, m_win32ThreadID); - fwprintf (stderr, L"\tTHROW DEPTH: 0x%08x\n", throw_depth); - fwprintf (stderr, L"\n" ); -} diff --git a/src/mysterx/dotnet/ThreadInfo.h b/src/mysterx/dotnet/ThreadInfo.h deleted file mode 100644 index f3aa1f1f15..0000000000 --- a/src/mysterx/dotnet/ThreadInfo.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include "baseinfo.h" - -enum TransitionState -{ - UNINITIALIZED, - MANAGED, - UNMANAGED -}; - -class ThreadInfo : - public BaseInfo -{ -public: - ThreadInfo(ThreadID threadID); - virtual ~ThreadInfo(void); - virtual void Dump(void); - UINT_PTR m_originalTID; - HANDLE m_hThread; - TransitionState m_status; - DWORD m_win32ThreadID; - DWORD throw_depth; - BOOL abort_deferred; -}; diff --git a/src/mysterx/dotnet/dotnet.cpp b/src/mysterx/dotnet/dotnet.cpp deleted file mode 100644 index 491252a5d9..0000000000 --- a/src/mysterx/dotnet/dotnet.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// dotnet.cpp : Implementation of DLL Exports. - -#include "stdafx.h" -#include "resource.h" - -// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you -[ module(dll, uuid = "{D89BBDEE-CA88-413D-B013-9A608E69FDA2}", - name = "DotnetProfiler", - helpstring = "MysterX Dotnet 1.0 Type Library", - resource_name = "IDR_DOTNET") ]; diff --git a/src/mysterx/dotnet/dotnet.rc b/src/mysterx/dotnet/dotnet.rc deleted file mode 100644 index 40c3f9913e..0000000000 --- a/src/mysterx/dotnet/dotnet.rc +++ /dev/null @@ -1,99 +0,0 @@ -//Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - - -#endif // APSTUDIO_INVOKED - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Notheastern University" - VALUE "FileDescription", "MysterX Dotnet hack" - VALUE "FileVersion", "1.0.0.1" - VALUE "LegalCopyright", "(c) PLT. All rights reserved." - VALUE "InternalName", "dotnet.dll" - VALUE "OriginalFilename", "dotnet.dll" - VALUE "ProductName", "MysterX Dotnet" - VALUE "ProductVersion", "1.0.0.1" - VALUE "OLESelfRegister", "" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_PROJNAME "DotnetProfiler" -END - -IDR_DOTNET REGISTRY "dotnet.rgs" -//////////////////////////////////////////////////////////////////////////// - - -#endif - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/mysterx/dotnet/dotnet.rgs b/src/mysterx/dotnet/dotnet.rgs deleted file mode 100644 index 880b1c5540..0000000000 --- a/src/mysterx/dotnet/dotnet.rgs +++ /dev/null @@ -1,11 +0,0 @@ -HKCR -{ - NoRemove AppID - { - '%APPID%' = s 'DotnetProfiler' - 'dotnet.DLL' - { - val AppID = s '%APPID%' - } - } -} diff --git a/src/mysterx/dotnet/dotnetps.def b/src/mysterx/dotnet/dotnetps.def deleted file mode 100644 index d5d5036469..0000000000 --- a/src/mysterx/dotnet/dotnetps.def +++ /dev/null @@ -1,9 +0,0 @@ - -LIBRARY "dotnetPS" - -EXPORTS - DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - GetProxyDllInfo PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE diff --git a/src/mysterx/dotnet/stdafx.cpp b/src/mysterx/dotnet/stdafx.cpp deleted file mode 100644 index e3943d05f8..0000000000 --- a/src/mysterx/dotnet/stdafx.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// dotnet.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "cordebug.h" diff --git a/src/mysterx/dotnet/stdafx.h b/src/mysterx/dotnet/stdafx.h deleted file mode 100644 index 32661ca67e..0000000000 --- a/src/mysterx/dotnet/stdafx.h +++ /dev/null @@ -1,49 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#ifndef STRICT -#define STRICT -#endif - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif - -#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later. -#endif - -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -#endif - -#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. -#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. -#endif - -#define _ATL_APARTMENT_THREADED -#define _ATL_NO_AUTOMATIC_NAMESPACE - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off ATL's hiding of some common and often safely ignored warning messages -#define _ATL_ALL_WARNINGS - -#include -#include -#include -#include -#include -#include - - -using namespace ATL; - -// All strings will be at most this long. Yeah, right. -#define MAX_LENGTH 256 - diff --git a/src/mysterx/dotnet/utils.cpp b/src/mysterx/dotnet/utils.cpp deleted file mode 100644 index 5bb529ca4b..0000000000 --- a/src/mysterx/dotnet/utils.cpp +++ /dev/null @@ -1,319 +0,0 @@ -#include "stdafx.h" -#include -#include "corhdr.h" -#include "cor.h" -#include "corhlpr.h" -#include "corprof.h" -#include "cordebug.h" -#include "SimpleException.h" -#include "utils.h" - -#define STRING_BUFFER_LEN 1024 - -int die (char const * szError, HRESULT hr) -{ - fprintf (stderr, "\nDIE: %s\n", szError); - fflush (stderr); - - if (hr != S_OK) { - IErrorInfo * pIErr = NULL; - BSTR bstrDesc = NULL; - - fprintf (stderr, "HRESULT = 0x%08x\n", hr); - - if (GetErrorInfo (0, &pIErr) == S_OK && - pIErr->GetDescription (&bstrDesc) == S_OK) { - fprintf (stderr, "%ls", bstrDesc); - fflush (stderr); - SysFreeString (bstrDesc); - } - if (pIErr) pIErr->Release(); - } - CoUninitialize(); - exit (hr); -} - -int show_trace (char * str, va_list marker) -{ - CQuickBytes buffer; - int count = -1; - int i = 1; - - while (count < 0) { -# if _MSC_VER < 1400 - HRESULT hr; - if (FAILED(hr = buffer.ReSize (STRING_BUFFER_LEN * i))) - die("Resize failed.", hr); -#else - buffer.ReSizeThrows (STRING_BUFFER_LEN * i); -#endif - count = _vsnprintf ((char *) buffer.Ptr(), STRING_BUFFER_LEN * i, str, marker); - i *= 2; - } - fprintf (stderr, "%s", (char *) buffer.Ptr()); - return count; -} - -int show_trace (char * str, ...) -{ - va_list marker; - int count; - - va_start (marker, str); - count = show_trace (str, marker); - va_end (marker); - fflush (stderr); - return count; -} - -int show_traceln (char * str, ...) -{ - va_list marker; - int count; - - va_start (marker, str); - count = show_trace (str, marker); - va_end (marker); - fprintf (stderr, "\n"); - fflush (stderr); - return count; -} - -#define DEBUG_ENVIRONMENT "DBG_PRF" - -#define MAX_LENGTH 256 - -#define _DbgBreak() __asm { int 3 } - -void Failure (char *message) -{ - if (message == NULL) - message = "**** SEVERE FAILURE: TURNING OFF APPLICABLE PROFILING EVENTS ****"; - - // - // Display the error message and turn off the profiler events except the - // IMMUTABLE ones. Turning off the IMMUTABLE events can cause crashes. The only - // place that we can safely enable or disable immutable events is the Initialize - // callback. - // - TEXT_OUTLN (message); -} // PrfInfo::Failure - -int String2Number (char * number) -{ - WCHAR ch; - int base; - int iIndex = 1; - BOOL errorOccurred = FALSE; - - - // check to see if this is a valid number - // if the first digit is '0', then this is - // a hex or octal number - if (number[0] == '0') { - // - // hex - // - if ((number[1] == 'x') || (number[1] == 'X')) { - iIndex++; - base = 16; - while ((errorOccurred == FALSE) - && ((ch = number[iIndex++]) != '\0')) { - if (((ch >= '0') && (ch <= '9')) - || ((ch >= 'a') && (ch <= 'f')) - || ((ch >= 'A') && (ch <= 'F'))) - continue; - else - errorOccurred = TRUE; - } - } - // - // octal - // - else { - base = 8; - while ((errorOccurred == FALSE) && - ((ch = number[iIndex++]) != '\0')) { - if ((ch >= '0') && (ch <= '7')) - continue; - else - errorOccurred = TRUE; - } - } - } - // - // decimal - // - else { - base = 10; - while ((errorOccurred == FALSE) - && ((ch = number[iIndex++]) != '\0')) { - if ((ch >= '0') && (ch <= '9')) - continue; - else - errorOccurred = TRUE; - } - } - - return ((errorOccurred == TRUE) ? -1 : base); -} - -DWORD GetEnvVarValue (char *value) -{ - int base = String2Number (value); - - return (base != -1) - ? (DWORD) strtoul (value, NULL, base) - : -1; -} - -DWORD FetchEnvironment (const char *environment) -{ - DWORD retVal = -1; - char buffer[MAX_LENGTH]; - - return (GetEnvironmentVariableA (environment, buffer, MAX_LENGTH) > 0 ) - ? GetEnvVarValue (buffer) - : -1; -} - -void LaunchDebugger (const char *szMsg, const char *szFile, int iLine) -{ - static DWORD launchDebugger = FetchEnvironment (DEBUG_ENVIRONMENT); - - if ((launchDebugger >= 1) && (launchDebugger != 0xFFFFFFFF)) { - char title[MAX_LENGTH]; - char message[MAX_LENGTH]; - - - sprintf (message, - "%s\n\n" \ - "File: %s\n" \ - "Line: %d\n", - ((szMsg == NULL) ? "FAILURE" : szMsg), - szFile, - iLine); - - sprintf (title, - "Test Failure (PID: %d/0x%08x, Thread: %d/0x%08x) ", - GetCurrentProcessId(), - GetCurrentProcessId(), - GetCurrentThreadId(), - GetCurrentThreadId()); - - switch (MessageBoxA (NULL, - message, - title, - (MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION))) { - case IDABORT: - TerminateProcess (GetCurrentProcess(), 999 /* bad exit code */ ); - break; - - case IDRETRY: - _DbgBreak(); - - - case IDIGNORE: - break; - } // switch - } - -} // BASEHELPER::LaunchDebugger - -mdTypeRef get_type_token (IMetaDataEmit * pMetaDataEmit, - LPCWSTR assembly_name, - unsigned short major_version, unsigned short minor_version, - unsigned short release, unsigned short revision, - BYTE k0, BYTE k1, BYTE k2, BYTE k3, - BYTE k4, BYTE k5, BYTE k6, BYTE k7, - LPCWSTR type_name) -{ - IMetaDataAssemblyEmit* pMetaDataAssemblyEmit; - - if (FAILED (pMetaDataEmit->QueryInterface (IID_IMetaDataAssemblyEmit, - (void **)&pMetaDataAssemblyEmit))) - _THROW_EXCEPTION ("QueryInterface IID_IMetaDataAssemblyEmit failed."); - - ASSEMBLYMETADATA amd; - ZeroMemory (&amd, sizeof (amd)); - amd.usMajorVersion = major_version; - amd.usMinorVersion = minor_version; - amd.usBuildNumber = release; - amd.usRevisionNumber = revision; - - BYTE key [] = {k0, k1, k2, k3, k4, k5, k6, k7}; - - mdModuleRef module_token; - if (FAILED (pMetaDataAssemblyEmit->DefineAssemblyRef (key, sizeof (key), - assembly_name, &amd, NULL, - 0, 0, &module_token))) - _THROW_EXCEPTION ("DefineAssemblyRef failed."); - - mdTypeRef type_token; - if (FAILED (pMetaDataEmit->DefineTypeRefByName (module_token, type_name, &type_token))) - _THROW_EXCEPTION ("DefineTypeRefByName failed."); - - pMetaDataAssemblyEmit->Release(); - return type_token; -} - -mdMemberRef signature_no_args (IMetaDataEmit * pMetaDataEmit, - mdTypeRef type_ref, - LPCWSTR member_name, - CorCallingConvention callconv, - CorElementType return_type) -{ - BYTE sigblob [] = {callconv, - 0x00, //argcount - return_type}; - - mdMemberRef token; - - if (FAILED (pMetaDataEmit->DefineMemberRef (type_ref, - member_name, - sigblob, - sizeof (sigblob), - &token))) - _THROW_EXCEPTION ("signature_no_args failed."); - - return token; -} - -mdMemberRef signature_one_arg (IMetaDataEmit * pMetaDataEmit, - mdTypeRef type_ref, - LPCWSTR member_name, - CorCallingConvention callconv, - CorElementType return_type, - CorElementType arg_type) -{ - BYTE sigblob [] = {callconv, - 0x01, //argcount - return_type, - arg_type}; - - mdMemberRef token; - - if (FAILED (pMetaDataEmit->DefineMemberRef (type_ref, - member_name, - sigblob, - sizeof (sigblob), - &token))) - _THROW_EXCEPTION ("signature_one_arg failed."); - - return token; -} - -mdSignature signature_unmanaged_one_arg (IMetaDataEmit * pMetaDataEmit, - CorUnmanagedCallingConvention callconv, - CorElementType return_type, - CorElementType arg_type) -{ - char sigblob [] = {callconv, - 0x01, //argcount - return_type, - arg_type}; - mdSignature msig; - - pMetaDataEmit->GetTokenFromSig ((PCCOR_SIGNATURE)sigblob, sizeof (sigblob), &msig); - return msig; -} diff --git a/src/mysterx/dotnet/utils.h b/src/mysterx/dotnet/utils.h deleted file mode 100644 index f750509bbe..0000000000 --- a/src/mysterx/dotnet/utils.h +++ /dev/null @@ -1,45 +0,0 @@ -void Failure (char *message = NULL); -void LaunchDebugger (const char *szMsg, const char *szFile, int iLine); -int show_traceln (char * str, ...); -int show_trace (char * str, ...); - -#define TEXT_OUTLN(message) printf ("%s\n", message) -#define _THROW_EXCEPTION(message) do { show_traceln (message); LaunchDebugger (message, __FILE__, __LINE__); throw new SimpleException (message);} while (0) - -// -// assert on false -// -#define _ASSERT_( expression ) do \ -{ \ - if ( !(expression) ) \ - LaunchDebugger( #expression, __FILE__, __LINE__ ); \ -} while (0) - - - -mdTypeRef get_type_token (IMetaDataEmit * pMetaDataEmit, - LPCWSTR assembly_name, - unsigned short major_version, unsigned short minor_version, - unsigned short release, unsigned short revision, - BYTE k0, BYTE k1, BYTE k2, BYTE k3, - BYTE k4, BYTE k5, BYTE k6, BYTE k7, - LPCWSTR type_name); - -mdMemberRef signature_no_args (IMetaDataEmit * pMetaDataEmit, - mdTypeRef type_ref, - LPCWSTR member_name, - CorCallingConvention callconv, - CorElementType return_type); - -mdMemberRef signature_one_arg (IMetaDataEmit * pMetaDataEmit, - mdTypeRef type_ref, - LPCWSTR member_name, - CorCallingConvention callconv, - CorElementType return_type, - CorElementType arg_type); - -mdSignature signature_unmanaged_one_arg (IMetaDataEmit * pMetaDataEmit, - CorUnmanagedCallingConvention callconv, - CorElementType return_type, - CorElementType arg_type); - diff --git a/src/mysterx/htmlutil.cxx b/src/mysterx/htmlutil.cxx index 81d91e1157..cbdb9c4801 100644 --- a/src/mysterx/htmlutil.cxx +++ b/src/mysterx/htmlutil.cxx @@ -992,7 +992,7 @@ Scheme_Object *fun_name(int argc,Scheme_Object **argv) { \ Scheme_Object *fun_name(int argc,Scheme_Object **argv) { \ HRESULT hr; \ IHTMLStyle *pIHTMLStyle; \ - long val; \ + intptr_t val; \ GUARANTEE_ELEMENT (scm_name, 0); \ GUARANTEE_INTEGER (scm_name, 1); \ pIHTMLStyle = styleInterfaceFromElement(argv[0]); \ diff --git a/src/mysterx/mysterx.cxx b/src/mysterx/mysterx.cxx index 5ae4b7428b..511c806564 100644 --- a/src/mysterx/mysterx.cxx +++ b/src/mysterx/mysterx.cxx @@ -2550,8 +2550,8 @@ Scheme_Object *mx_com_event_type(int argc, Scheme_Object **argv) BOOL schemeValueFitsVarType(Scheme_Object *val, VARTYPE vt) { - long int longInt; - unsigned long uLongInt; + intptr_t longInt; + uintptr_t uLongInt; switch (vt) { @@ -2765,8 +2765,10 @@ void marshalSchemeValueToVariant(Scheme_Object *val, VARIANTARG *pVariantArg) } else if (SCHEME_EXACT_INTEGERP(val)) { + intptr_t lv; pVariantArg->vt = VT_I4; - scheme_get_int_val(val, &pVariantArg->lVal); + scheme_get_int_val(val, &lv); + pVariantArg->lVal = lv; } #ifdef MZ_USE_SINGLE_FLOATS @@ -2834,8 +2836,10 @@ void marshalSchemeValueToVariant(Scheme_Object *val, VARIANTARG *pVariantArg) else if (scheme_apply(mx_marshal_raw_scheme_objects, 0, NULL) == scheme_false) scheme_signal_error("Unable to inject Scheme value %V into VARIANT", val); else { + uintptr_t v2; pVariantArg->vt = VT_INT; - pVariantArg->intVal = PtrToInt(val); + v2 = PtrToInt(val); + pVariantArg->intVal = v2; } return; } @@ -3359,7 +3363,7 @@ void unmarshalArgSchemeObject(Scheme_Object *obj,VARIANTARG *pVariantArg) { case VT_I4 | VT_BYREF : - long lVal; + intptr_t lVal; if (SCHEME_EXACT_INTEGERP(val) == FALSE) { handlerUpdateError("exact integer"); @@ -4157,6 +4161,7 @@ void allocateDirectRetval(VARIANT *va) } } +#ifndef _WIN64 static VARIANT argVas[MAXDIRECTARGS]; static VARIANT optArgVas[MAXDIRECTARGS]; @@ -4276,6 +4281,7 @@ END_XFORM_SKIP; return retval; } +#endif static Scheme_Object *mx_make_call(int argc, Scheme_Object **argv, INVOKEKIND invKind) @@ -4311,6 +4317,7 @@ static Scheme_Object *mx_make_call(int argc, Scheme_Object **argv, pTypeDesc = getMethodType((MX_COM_Object *)argv[0], name, invKind); +#ifndef _WIN64 // try direct call via function pointer // otherwise, use COM Automation @@ -4320,6 +4327,7 @@ static Scheme_Object *mx_make_call(int argc, Scheme_Object **argv, (retval = mx_make_direct_call(argc, argv, invKind, pIDispatch, name, pTypeDesc))) return retval; +#endif if (pTypeDesc) dispid = pTypeDesc->memID; @@ -5407,7 +5415,9 @@ void browserHwndMsgLoop(LPVOID p) SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~1L); +#ifndef _WIN64 SetClassLong(hwnd, GCL_HICON, HandleToLong(hIcon)); +#endif SetWindowText(hwnd, pBrowserWindowInit->browserWindow.label); diff --git a/src/mzcom/mzobj.cxx b/src/mzcom/mzobj.cxx index 87350bd7e9..01bdbf0ac4 100644 --- a/src/mzcom/mzobj.cxx +++ b/src/mzcom/mzobj.cxx @@ -305,7 +305,9 @@ static void record_at_exit(Scheme_At_Exit_Callback_Proc p) XFORM_SKIP_PROC static __declspec(thread) void *tls_space; static unsigned WINAPI evalLoop(void *args) XFORM_SKIP_PROC { +#ifndef _WIN64 scheme_register_tls_space(&tls_space, 0); +#endif scheme_set_atexit(record_at_exit); return scheme_main_setup(1, do_evalLoop, 0, (char **)args); } @@ -493,7 +495,7 @@ STDMETHODIMP CMzObj::Eval(BSTR input, BSTR *output) { return hr; } -BOOL WINAPI dlgProc(HWND hDlg,UINT msg,WPARAM wParam,LPARAM) { +LONG_PTR WINAPI dlgProc(HWND hDlg,UINT msg,WPARAM wParam,LPARAM) { switch(msg) { case WM_INITDIALOG : SetDlgItemText(hDlg,MZCOM_URL, diff --git a/src/worksp/README b/src/worksp/README index 63c40ecbab..ad3482af44 100644 --- a/src/worksp/README +++ b/src/worksp/README @@ -1,8 +1,8 @@ This directory contains - solution files and project files for building Racket and GRacket - with Microsoft Visual Studio 8.0 and up (which work with the Express - 2005 version of Visual Studio); + with Microsoft Visual Studio 2008 (a.k.a. version 9.0) and up, + which work with the Express version of Visual Studio; - mzconfig.h which is a manual version of information that is gathered automatically when using the "configure" script; @@ -11,7 +11,7 @@ This directory contains Studio command-line tools; and - solution files and project files for building MzCOM and MysterX with - Microsoft Visual Studio 8.0 (not Express, which doesn't support ATL + Microsoft Visual Studio 2008 (not Express, which doesn't support ATL and MFC). Visual Studio Express is available for free from Microsoft; it can be @@ -41,21 +41,23 @@ As always, please report bugs via one of the following: Building Racket and GRacket --------------------------- -If you're using MSVC 8.0 (not Express), and if `devenv.exe' is in your +If you're using MSVC 2008 (not Express), and if `devenv.exe' is in your path, then you can just run racket\src\worksp\build.bat from its own directory to perform all steps up to "Versioning", including the MzCOM and MysterX steps. +If your MSVC environment is configured for 64-bit builds (e.g., by +running "vcvarsall.bat" with "x64), then a 64-bit build is created. + The CGC variants of Racket, GRacket, MzCOM, and MysterX can be built via Visual Studio projects. The 3m variants are built by a Racket script that runs the MSVC command-line tools. (See "CGC versus 3m" in racket\src\README if you don't know about the two variants.) -The 3m build requires: - racket\src\worksp\racket -It's simplest to just build the main CGC solutions, which automatically -build all of the above projects, and then build 3m. + +If you can't run "build.bat" or don't want to, you have to perform +several steps: first builg RacketCGC, then build Racket3m, etc. Building RacketCGC and GRacketCGC --------------------------------- @@ -85,7 +87,15 @@ In addition, building RacketCGC executes racket\src\racket\dynsrc\mkmzdyn.bat which copies .exp, .obj, and .lib files into racket\lib\. -Finally, you must install pre-build DLLs that GRacket needs to run. +Downloading Pre-Built Binaries +------------------------------- + +You must install some pre-built DLLs if you want text-encoding +converts, OpenSSL support, `racket/draw', or `racket/gui' support. +In principle, you could build them from scratch, but since they +are (mostly) maintained by people and organizations other than +PLT, we supply them in binary form. + The DLLs are available from http://download.racket-lang.org/libs/ @@ -97,14 +107,13 @@ and they must be installed into The "get-libs.rkt" script in "racket\src" can download the libraries, and the script is used by "build.bat". - Building Racket3m and GRacket3m ------------------------------- After RacketCGC and GRacketCGC are built, you can can build 3m binaries: 1. Ensure that the Visual Studio command-line tools are in your path. - You may need to run "vsvars32.bat" from your Visual Studio + You may need to run "vcvarsall.bat" from your Visual Studio installation, so that PATH and other environment variables are set. 2. Change directories to racket\src\worksp\gc2 and run diff --git a/src/worksp/gracket/gracket.sln b/src/worksp/gracket/gracket.sln index 5cb78026da..7ea6a9d7f0 100644 --- a/src/worksp/gracket/gracket.sln +++ b/src/worksp/gracket/gracket.sln @@ -19,25 +19,43 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D59A2B28-330B-41F5-8261-F5BC1019E163}.Debug|Win32.ActiveCfg = Debug|Win32 {D59A2B28-330B-41F5-8261-F5BC1019E163}.Debug|Win32.Build.0 = Debug|Win32 + {D59A2B28-330B-41F5-8261-F5BC1019E163}.Debug|x64.ActiveCfg = Debug|x64 + {D59A2B28-330B-41F5-8261-F5BC1019E163}.Debug|x64.Build.0 = Debug|x64 {D59A2B28-330B-41F5-8261-F5BC1019E163}.Release|Win32.ActiveCfg = Release|Win32 {D59A2B28-330B-41F5-8261-F5BC1019E163}.Release|Win32.Build.0 = Release|Win32 + {D59A2B28-330B-41F5-8261-F5BC1019E163}.Release|x64.ActiveCfg = Release|x64 + {D59A2B28-330B-41F5-8261-F5BC1019E163}.Release|x64.Build.0 = Release|x64 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|Win32.ActiveCfg = Debug|Win32 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|Win32.Build.0 = Debug|Win32 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|x64.ActiveCfg = Debug|x64 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|x64.Build.0 = Debug|x64 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|Win32.ActiveCfg = Release|Win32 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|Win32.Build.0 = Release|Win32 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|x64.ActiveCfg = Release|x64 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|x64.Build.0 = Release|x64 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|Win32.ActiveCfg = Debug|Win32 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|Win32.Build.0 = Debug|Win32 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|x64.ActiveCfg = Debug|x64 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|x64.Build.0 = Debug|x64 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|Win32.ActiveCfg = Release|Win32 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|Win32.Build.0 = Release|Win32 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|x64.ActiveCfg = Release|x64 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|x64.Build.0 = Release|x64 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|Win32.ActiveCfg = Debug|Win32 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|Win32.Build.0 = Debug|Win32 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|x64.ActiveCfg = Debug|x64 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|x64.Build.0 = Debug|x64 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|Win32.ActiveCfg = Release|Win32 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|Win32.Build.0 = Release|Win32 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|x64.ActiveCfg = Release|x64 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/worksp/gracket/gracket.vcproj b/src/worksp/gracket/gracket.vcproj index f172fbf802..82dea0621e 100644 --- a/src/worksp/gracket/gracket.vcproj +++ b/src/worksp/gracket/gracket.vcproj @@ -10,6 +10,9 @@ + @@ -187,6 +190,183 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/worksp/libmysterx/.gitignore b/src/worksp/libmysterx/.gitignore index b2f16052e2..ac90143d35 100644 --- a/src/worksp/libmysterx/.gitignore +++ b/src/worksp/libmysterx/.gitignore @@ -13,10 +13,12 @@ dotnet/Release myspage/Release myspage/*.idb myspage/*.user +myspage/x64 myssink/Release myssink/*.idb myssink/*.user +myssink/x64 gc_traverse.inc 3m diff --git a/src/worksp/libmysterx/dotnet/dotnet.vcproj b/src/worksp/libmysterx/dotnet/dotnet.vcproj deleted file mode 100644 index 66ce515cb8..0000000000 --- a/src/worksp/libmysterx/dotnet/dotnet.vcproj +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/worksp/libmysterx/dotnet/dotnetPS.vcproj b/src/worksp/libmysterx/dotnet/dotnetPS.vcproj deleted file mode 100644 index ddb984f048..0000000000 --- a/src/worksp/libmysterx/dotnet/dotnetPS.vcproj +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/worksp/libmysterx/libmysterx.sln b/src/worksp/libmysterx/libmysterx.sln index e72e7868b8..53dc85bae5 100644 --- a/src/worksp/libmysterx/libmysterx.sln +++ b/src/worksp/libmysterx/libmysterx.sln @@ -13,28 +13,47 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution 3m|Win32 = 3m|Win32 + 3m|x64 = 3m|x64 Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.3m|Win32.ActiveCfg = Release|Win32 {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.3m|Win32.Build.0 = Release|Win32 + {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.3m|x64.ActiveCfg = Release|x64 {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Debug|Win32.ActiveCfg = Debug|Win32 {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Debug|Win32.Build.0 = Debug|Win32 + {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Debug|x64.ActiveCfg = Debug|x64 + {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Debug|x64.Build.0 = Debug|x64 {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Release|Win32.ActiveCfg = Release|Win32 {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Release|Win32.Build.0 = Release|Win32 + {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Release|x64.ActiveCfg = Release|x64 + {4F5E803D-985F-43B1-8BDC-B8F6D12F56B8}.Release|x64.Build.0 = Release|x64 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.3m|Win32.ActiveCfg = Release|Win32 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.3m|Win32.Build.0 = Release|Win32 + {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.3m|x64.ActiveCfg = Release|x64 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Debug|Win32.ActiveCfg = Debug|Win32 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Debug|Win32.Build.0 = Debug|Win32 + {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Debug|x64.ActiveCfg = Debug|x64 + {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Debug|x64.Build.0 = Debug|x64 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Release|Win32.ActiveCfg = Release|Win32 {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Release|Win32.Build.0 = Release|Win32 + {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Release|x64.ActiveCfg = Release|x64 + {1B8F4E47-9F2D-45EA-9941-7672B28E8285}.Release|x64.Build.0 = Release|x64 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.3m|Win32.ActiveCfg = 3m|Win32 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.3m|Win32.Build.0 = 3m|Win32 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.3m|x64.ActiveCfg = 3m|x64 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.3m|x64.Build.0 = 3m|x64 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Debug|Win32.ActiveCfg = Debug|Win32 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Debug|Win32.Build.0 = Debug|Win32 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Debug|x64.ActiveCfg = Debug|x64 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Debug|x64.Build.0 = Debug|x64 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Release|Win32.ActiveCfg = Release|Win32 {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Release|Win32.Build.0 = Release|Win32 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Release|x64.ActiveCfg = Release|x64 + {68D1B4E0-D9D3-45C3-9BCC-A5491F1F755A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/worksp/libmysterx/libmysterx.vcproj b/src/worksp/libmysterx/libmysterx.vcproj index 0d647ce041..f5531232f3 100644 --- a/src/worksp/libmysterx/libmysterx.vcproj +++ b/src/worksp/libmysterx/libmysterx.vcproj @@ -11,6 +11,9 @@ + @@ -110,9 +113,9 @@ /> @@ -139,7 +143,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\include;..\..\mysterx\myspage;..\..\mysterx\myssink" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBMYSTERX_EXPORTS;MYSTERX_DOTNET" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBMYSTERX_EXPORTS" StringPooling="false" MinimalRebuild="false" ExceptionHandling="1" @@ -165,10 +169,9 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/worksp/libmysterx/myspage/myspage.vcproj b/src/worksp/libmysterx/myspage/myspage.vcproj index 9887ac16f6..3feb14cd32 100644 --- a/src/worksp/libmysterx/myspage/myspage.vcproj +++ b/src/worksp/libmysterx/myspage/myspage.vcproj @@ -11,6 +11,9 @@ + @@ -114,9 +117,9 @@ /> + + + + + + + + + + + + + + + + + + + @@ -366,6 +472,17 @@ InterfaceIdentifierFileName="$(InputName)_i.c" /> + + + @@ -374,6 +491,14 @@ OutputDirectory="$(InputDir)" /> + + + + + + @@ -394,6 +527,14 @@ ResourceOutputFileName="$(InputDir)\$(InputName).res" /> + + + diff --git a/src/worksp/libmysterx/myssink/myssink.vcproj b/src/worksp/libmysterx/myssink/myssink.vcproj index f0ac50c4ce..653ba09108 100644 --- a/src/worksp/libmysterx/myssink/myssink.vcproj +++ b/src/worksp/libmysterx/myssink/myssink.vcproj @@ -11,6 +11,9 @@ + @@ -114,9 +117,9 @@ /> + + + + + + + + + + + + + + + + + + + @@ -353,6 +461,15 @@ OutputDirectory="$(InputDir)" /> + + + @@ -361,6 +478,14 @@ OutputDirectory="$(InputDir)" /> + + + + + + @@ -381,6 +514,14 @@ ResourceOutputFileName="$(InputDir)\$(InputName).res" /> + + + diff --git a/src/worksp/mrstart/mrstart.sln b/src/worksp/mrstart/mrstart.sln index efa2672527..29173af77d 100644 --- a/src/worksp/mrstart/mrstart.sln +++ b/src/worksp/mrstart/mrstart.sln @@ -5,10 +5,13 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {138CC248-8A45-436E-A4A6-E7570D7C2C0F}.Release|Win32.ActiveCfg = Release|Win32 {138CC248-8A45-436E-A4A6-E7570D7C2C0F}.Release|Win32.Build.0 = Release|Win32 + {138CC248-8A45-436E-A4A6-E7570D7C2C0F}.Release|x64.ActiveCfg = Release|x64 + {138CC248-8A45-436E-A4A6-E7570D7C2C0F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/worksp/mrstart/mrstart.vcproj b/src/worksp/mrstart/mrstart.vcproj index 3fb38778f8..0c1b1dd9d6 100644 --- a/src/worksp/mrstart/mrstart.vcproj +++ b/src/worksp/mrstart/mrstart.vcproj @@ -10,6 +10,9 @@ + @@ -103,6 +106,95 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + diff --git a/src/worksp/mzcom/MzCOM.vcproj b/src/worksp/mzcom/MzCOM.vcproj index 52cf5f5dcc..8fdfd28eba 100644 --- a/src/worksp/mzcom/MzCOM.vcproj +++ b/src/worksp/mzcom/MzCOM.vcproj @@ -10,6 +10,9 @@ + @@ -100,6 +103,94 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/worksp/mzcom/mzcom.sln b/src/worksp/mzcom/mzcom.sln index 5e452c8b6c..761b401a3f 100644 --- a/src/worksp/mzcom/mzcom.sln +++ b/src/worksp/mzcom/mzcom.sln @@ -19,34 +19,61 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution 3m|Win32 = 3m|Win32 + 3m|x64 = 3m|x64 Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {36F31050-55C6-41A3-A23E-3008EBFC1273}.3m|Win32.ActiveCfg = 3m|Win32 {36F31050-55C6-41A3-A23E-3008EBFC1273}.3m|Win32.Build.0 = 3m|Win32 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.3m|x64.ActiveCfg = 3m|x64 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.3m|x64.Build.0 = 3m|x64 {36F31050-55C6-41A3-A23E-3008EBFC1273}.Debug|Win32.ActiveCfg = Debug|Win32 {36F31050-55C6-41A3-A23E-3008EBFC1273}.Debug|Win32.Build.0 = Debug|Win32 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.Debug|x64.ActiveCfg = Debug|x64 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.Debug|x64.Build.0 = Debug|x64 {36F31050-55C6-41A3-A23E-3008EBFC1273}.Release|Win32.ActiveCfg = Release|Win32 {36F31050-55C6-41A3-A23E-3008EBFC1273}.Release|Win32.Build.0 = Release|Win32 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.Release|x64.ActiveCfg = Release|x64 + {36F31050-55C6-41A3-A23E-3008EBFC1273}.Release|x64.Build.0 = Release|x64 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.3m|Win32.ActiveCfg = Release|Win32 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.3m|Win32.Build.0 = Release|Win32 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.3m|x64.ActiveCfg = Release|x64 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.3m|x64.Build.0 = Release|x64 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|Win32.ActiveCfg = Debug|Win32 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|Win32.Build.0 = Debug|Win32 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|x64.ActiveCfg = Debug|x64 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Debug|x64.Build.0 = Debug|x64 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|Win32.ActiveCfg = Release|Win32 {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|Win32.Build.0 = Release|Win32 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|x64.ActiveCfg = Release|x64 + {A6713577-7DFB-48F8-B8C1-7DB2D7C51F90}.Release|x64.Build.0 = Release|x64 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.3m|Win32.ActiveCfg = Release|Win32 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.3m|Win32.Build.0 = Release|Win32 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.3m|x64.ActiveCfg = Release|x64 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.3m|x64.Build.0 = Release|x64 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|Win32.ActiveCfg = Debug|Win32 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|Win32.Build.0 = Debug|Win32 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|x64.ActiveCfg = Debug|x64 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Debug|x64.Build.0 = Debug|x64 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|Win32.ActiveCfg = Release|Win32 {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|Win32.Build.0 = Release|Win32 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|x64.ActiveCfg = Release|x64 + {66548E7B-294E-40EF-B7C0-C8D6D7E6234F}.Release|x64.Build.0 = Release|x64 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.3m|Win32.ActiveCfg = Release|Win32 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.3m|Win32.Build.0 = Release|Win32 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.3m|x64.ActiveCfg = Release|x64 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.3m|x64.Build.0 = Release|x64 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|Win32.ActiveCfg = Debug|Win32 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|Win32.Build.0 = Debug|Win32 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|x64.ActiveCfg = Debug|x64 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Debug|x64.Build.0 = Debug|x64 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|Win32.ActiveCfg = Release|Win32 {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|Win32.Build.0 = Release|Win32 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|x64.ActiveCfg = Release|x64 + {7DB29F1E-06FD-4E39-97FF-1C7922F6901A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/worksp/mzstart/mzstart.sln b/src/worksp/mzstart/mzstart.sln index 8db9d37b85..adaaece83c 100644 --- a/src/worksp/mzstart/mzstart.sln +++ b/src/worksp/mzstart/mzstart.sln @@ -5,10 +5,13 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {838B0D91-A8B3-4716-9D37-E0E444B563D2}.Release|Win32.ActiveCfg = Release|Win32 {838B0D91-A8B3-4716-9D37-E0E444B563D2}.Release|Win32.Build.0 = Release|Win32 + {838B0D91-A8B3-4716-9D37-E0E444B563D2}.Release|x64.ActiveCfg = Release|x64 + {838B0D91-A8B3-4716-9D37-E0E444B563D2}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/worksp/mzstart/mzstart.vcproj b/src/worksp/mzstart/mzstart.vcproj index 74d44408a4..ac7ae9f892 100644 --- a/src/worksp/mzstart/mzstart.vcproj +++ b/src/worksp/mzstart/mzstart.vcproj @@ -10,6 +10,9 @@ + @@ -97,6 +100,90 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + +