FCIMPL2(FC_BOOL_RET, SystemNative::ValidateSystemTime, SYSTEMTIME *time, CLR_BOOL localTime) { FCALL_CONTRACT; if (localTime) { SYSTEMTIME st; FC_RETURN_BOOL(::TzSpecificLocalTimeToSystemTime(NULL, time, &st)); } else { FILETIME timestamp; FC_RETURN_BOOL(::SystemTimeToFileTime(time, ×tamp)); } }
FCIMPL2(FC_BOOL_RET, SystemNative::SystemTimeToFileTime, SYSTEMTIME *time, INT64 *pFileTime) { FCALL_CONTRACT; BOOL ret = ::SystemTimeToFileTime(time, (LPFILETIME) pFileTime); FC_RETURN_BOOL(ret); }
FCIMPLEND FCIMPL1(FC_BOOL_RET, SystemNative::_GetCompatibilityFlag, int flag) { FCALL_CONTRACT; FC_RETURN_BOOL(GetCompatibilityFlag((CompatibilityFlag)flag)); }
FCIMPL0(FC_BOOL_RET, SystemNative::HasShutdownStarted) { FCALL_CONTRACT; // Return true if the EE has started to shutdown and is now going to // aggressively finalize objects referred to by static variables OR // if someone is unloading the current AppDomain AND we have started // finalizing objects referred to by static variables. FC_RETURN_BOOL(g_fEEShutDown & ShutDown_Finalize2); }
FCIMPL2(FC_BOOL_RET, SystemNative::FileTimeToSystemTime, INT64 fileTime, FullSystemTime *time) { FCALL_CONTRACT; if (::FileTimeToSystemTime((FILETIME*)&fileTime, (LPSYSTEMTIME) time)) { // to keep the time precision time->hundredNanoSecond = fileTime % 10000; // 10000 is the number of 100-nano seconds per Millisecond if (time->systemTime.wSecond > 59) { // we have a leap second, force it to last second in the minute as DateTime doesn't account for leap seconds in its calculation. // we use the maxvalue from the milliseconds and the 100-nano seconds to avoid reporting two out of order 59 seconds time->systemTime.wSecond = 59; time->systemTime.wMilliseconds = 999; time->hundredNanoSecond = 9999; } FC_RETURN_BOOL(TRUE); } FC_RETURN_BOOL(FALSE); }
FCIMPLEND /// "parse" tells us to parse the simple name of the assembly as if it was the full name /// almost never the right thing to do, but needed for compat /* static */ FCIMPL3(FC_BOOL_RET, AssemblyNameNative::ReferenceMatchesDefinition, AssemblyNameBaseObject* refUNSAFE, AssemblyNameBaseObject* defUNSAFE, CLR_BOOL fParse) { FCALL_CONTRACT; struct _gc { ASSEMBLYNAMEREF pRef; ASSEMBLYNAMEREF pDef; } gc; gc.pRef = (ASSEMBLYNAMEREF)ObjectToOBJECTREF (refUNSAFE); gc.pDef = (ASSEMBLYNAMEREF)ObjectToOBJECTREF (defUNSAFE); BOOL result = FALSE; HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); Thread *pThread = GetThread(); CheckPointHolder cph(pThread->m_MarshalAlloc.GetCheckpoint()); //hold checkpoint for autorelease if (gc.pRef == NULL) COMPlusThrow(kArgumentNullException, W("ArgumentNull_AssemblyName")); if (gc.pDef == NULL) COMPlusThrow(kArgumentNullException, W("ArgumentNull_AssemblyName")); AssemblySpec refSpec; refSpec.InitializeSpec(&(pThread->m_MarshalAlloc), (ASSEMBLYNAMEREF*) &gc.pRef, fParse, FALSE); AssemblySpec defSpec; defSpec.InitializeSpec(&(pThread->m_MarshalAlloc), (ASSEMBLYNAMEREF*) &gc.pDef, fParse, FALSE); #ifdef FEATURE_FUSION SafeComHolder<IAssemblyName> pRefName (NULL); IfFailThrow(refSpec.CreateFusionName(&pRefName, FALSE)); SafeComHolder <IAssemblyName> pDefName (NULL); IfFailThrow(defSpec.CreateFusionName(&pDefName, FALSE)); // Order matters: Ref->IsEqual(Def) result = (S_OK == pRefName->IsEqual(pDefName, ASM_CMPF_IL_ALL)); #else result=AssemblySpec::RefMatchesDef(&refSpec,&defSpec); #endif HELPER_METHOD_FRAME_END(); FC_RETURN_BOOL(result); }