当前位置: 首页>>代码示例>>C++>>正文


C++ KeQuerySystemTime函数代码示例

本文整理汇总了C++中KeQuerySystemTime函数的典型用法代码示例。如果您正苦于以下问题:C++ KeQuerySystemTime函数的具体用法?C++ KeQuerySystemTime怎么用?C++ KeQuerySystemTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了KeQuerySystemTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BalloonPopulatePfnArray

static BOOLEAN
BalloonPopulatePfnArray(
    IN  ULONG                   Requested,
    OUT PULONG                  pPopulated
    )
{
    xen_memory_reservation_t    reservation;
    LARGE_INTEGER               Start;
    LARGE_INTEGER               End;
    ULONGLONG                   TimeDelta;
    BOOLEAN                     Slow;
    ULONG                       Populated;

    XM_ASSERT(Requested <= BALLOON_PFN_ARRAY_SIZE);

    KeQuerySystemTime(&Start);

    RangeSetPopMany(&(Balloon.PfnsBalloonedOut),
                    &(Balloon.PfnArray[0]),
                    Requested);

    SET_XEN_GUEST_HANDLE(reservation.extent_start, Balloon.PfnArray);
    reservation.extent_order = 0;
    reservation.mem_flags = 0;   // unused
    reservation.domid = DOMID_SELF;
    reservation.nr_extents = Requested;

    Populated = HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation);
    if (Populated < Requested) {
        Balloon.PartialPopulate++;

        // This should not fail as we're simply handing back part of a range we'd previously popped.
        RangeSetAddItems(&(Balloon.PfnsBalloonedOut),
                         &(Balloon.PfnArray[Populated]),
                         Requested - Populated);
    } else if (Populated > Requested) {
        XM_BUG();
    }

    RangeSetDropRseCache(&(Balloon.PfnsBalloonedOut));

    TraceVerbose(("%s: %d page(s)\n", __FUNCTION__, Populated));

    KeQuerySystemTime(&End);
    TimeDelta = (End.QuadPart - Start.QuadPart) / 10000ull;

    Slow = FALSE;
    if (TimeDelta != 0) {
        ULONGLONG   Rate;

        Rate = (ULONGLONG)(Populated * 1000) / TimeDelta;
        if (Rate < MIN_PAGES_PER_S) {
            TraceWarning(("%s: ran for more than %dms\n", __FUNCTION__, TimeDelta));
            Slow = TRUE;
        }
    }

    *pPopulated = Populated;
    return Slow;
}
开发者ID:OpenXT,项目名称:xc-windows,代码行数:60,代码来源:balloon.c

示例2: sys_arch_mbox_fetch

u32_t
sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
{
    LARGE_INTEGER LargeTimeout, PreWaitTime, PostWaitTime;
    UINT64 TimeDiff;
    NTSTATUS Status;
    PVOID Message;
    PLWIP_MESSAGE_CONTAINER Container;
    PLIST_ENTRY Entry;
    KIRQL OldIrql;
    PVOID WaitObjects[] = {&mbox->Event, &TerminationEvent};
    
    LargeTimeout.QuadPart = Int32x32To64(timeout, -10000);
    
    KeQuerySystemTime(&PreWaitTime);

    Status = KeWaitForMultipleObjects(2,
                                      WaitObjects,
                                      WaitAny,
                                      Executive,
                                      KernelMode,
                                      FALSE,
                                      timeout != 0 ? &LargeTimeout : NULL,
                                      NULL);

    if (Status == STATUS_WAIT_0)
    {
        KeAcquireSpinLock(&mbox->Lock, &OldIrql);
        Entry = RemoveHeadList(&mbox->ListHead);
        ASSERT(Entry);
        if (IsListEmpty(&mbox->ListHead))
            KeClearEvent(&mbox->Event);
        KeReleaseSpinLock(&mbox->Lock, OldIrql);
        
        Container = CONTAINING_RECORD(Entry, LWIP_MESSAGE_CONTAINER, ListEntry);
        Message = Container->Message;
        ExFreePool(Container);
        
        if (msg)
            *msg = Message;

        KeQuerySystemTime(&PostWaitTime);
        TimeDiff = PostWaitTime.QuadPart - PreWaitTime.QuadPart;
        TimeDiff /= 10000;
        
        return TimeDiff;
    }
    else if (Status == STATUS_WAIT_1)
    {
        /* DON'T remove ourselves from the thread list! */
        PsTerminateSystemThread(STATUS_SUCCESS);
        
        /* We should never get here! */
        ASSERT(FALSE);
        
        return 0;
    }
    
    return SYS_ARCH_TIMEOUT;
}
开发者ID:GYGit,项目名称:reactos,代码行数:60,代码来源:sys_arch.c

示例3: getSystemTime

unsigned long getSystemTime()
{
	LARGE_INTEGER time;	
	KeQuerySystemTime(&time);
	
	return (unsigned long) ((time.QuadPart / 10000000) - 11643609600);
}
开发者ID:pgebhard,项目名称:intellidrive,代码行数:7,代码来源:windows-system-interface.c

示例4: ProcessCreationCB

//Callback from process creation.
VOID ProcessCreationCB(
_In_ HANDLE ParentId,
_In_ HANDLE ProcessId,
_In_ BOOLEAN Create)
{
	PRECORD_LIST recordList = SpyNewRecord();
	if (!recordList)
		return;

	if (Create)
	{
		recordList->LogRecord.Data.RecordType = CREATE_OP;
		recordList->LogRecord.Data.ProcessId = (FILE_ID)ProcessId;
		recordList->LogRecord.Data.ThreadId = (FILE_ID)ParentId;
	}
	else
	{
		recordList->LogRecord.Data.RecordType = EXIT_OP;
		recordList->LogRecord.Data.ProcessId = (FILE_ID)ProcessId;
	}
	//Set the time for the originating and completion itme.
	KeQuerySystemTime(&recordList->LogRecord.Data.OriginatingTime);
	recordList->LogRecord.Data.CompletionTime = recordList->LogRecord.Data.OriginatingTime;
	//Set the name to ""
	UNICODE_STRING emptySTR;
	RtlInitUnicodeString(&emptySTR, L"");
	SpySetRecordNameAndEcpData(&recordList->LogRecord, &emptySTR, &emptySTR);
	//Send to the userland!
	SpyLog(recordList);
}
开发者ID:340211173,项目名称:Kminispy,代码行数:31,代码来源:minispy.c

示例5: Filter

VOID __stdcall Filter(ULONG ServiceId, ULONG TableBase, ULONG Argc, ULONG StackAddr) {
	ULONG pid = (ULONG)PsGetCurrentProcessId();
	if (pid == g_nPid) {
		ULONG i;
		PXBoxData pData=(PXBoxData)ExAllocateFromNPagedLookasideList(&g_nPageList);
		if(!pData)
			return;
		
		if (StackAddr < MmUserProbeAddress)
			pData->bFromUser = 1;
		else
			pData->bFromUser = 0;
		
		if (TableBase == (ULONG)KeServiceDescriptorTable.ServiceTableBase)
			pData->bFromSSDT = 1;
		else
			pData->bFromSSDT = 0;

		if (Argc > 16)
			Argc = 16;
		pData->argc = (UCHAR)Argc;
		for (i = 0; i < Argc; ++i)
			pData->args[i] = ((PULONG)StackAddr)[i];

		pData->pid = (ULONG)pid;
		pData->tid = (ULONG)PsGetCurrentThreadId();
		pData->sid = ServiceId;
		KeQuerySystemTime(&pData->time);
		ExInterlockedInsertTailList(&g_linkListHead, &pData->ListEntry, &g_lock);
		KeReleaseSemaphore( &g_keySemaphore, 0, 1, FALSE );
	}
}
开发者ID:340211173,项目名称:hf-2011,代码行数:32,代码来源:XBox.c

示例6: fb_Timer

FBCALL double fb_Timer( void )
{
#if defined( HOST_DOS ) || defined( HOST_UNIX )
	struct timeval tv;
	gettimeofday(&tv, NULL);
	return (((double)tv.tv_sec * 1000000.0) + (double)tv.tv_usec) * 0.000001;

#elif defined( HOST_WIN32 )
	LARGE_INTEGER count;

	if( timer == TIMER_NONE ) {
		if( QueryPerformanceFrequency( &count ) ) {
			frequency = 1.0 / (double)count.QuadPart;
			timer = TIMER_HIGHRES;
		} else {
			timer = TIMER_NORMAL;
		}
	}

	if( timer == TIMER_NORMAL ) {
		return (double)GetTickCount( ) * 0.001;
	} else {
		QueryPerformanceCounter( &count );
		return (double)count.QuadPart * frequency;
	}

#elif defined( HOST_XBOX )
	LARGE_INTEGER t;
	KeQuerySystemTime(&t);
	return ((double)(t.QuadPart) * 100.0);

#else
#	error TODO
#endif
}
开发者ID:jofers,项目名称:fbc,代码行数:35,代码来源:time_timer.c

示例7: SpyLogPostOperationData

VOID
SpyLogPostOperationData (
	_In_ PCFLT_RELATED_OBJECTS FltObjects,
    _Inout_ PRECORD_LIST RecordList
    )
/*++

Routine Description:

    This is called from the post-operation callback routine to copy the
    necessary information into the log record.

    NOTE:  This code must be NON-PAGED because it can be called on the
           paging path or at DPC level.

Arguments:

    Data - The Data structure that contains the information we want to record.

    RecordList - Where we want to save the data

Return Value:

    None.

--*/
{
	UNREFERENCED_PARAMETER(FltObjects);

    PRECORD_DATA recordData = &RecordList->LogRecord.Data;
	recordData->Flags = 0;
    KeQuerySystemTime( &recordData->CompletionTime );
}
开发者ID:CenterDevice,项目名称:MiniFSWatcher,代码行数:33,代码来源:mspyLib.c

示例8: IoWriteErrorLogEntry

/*
 * @implemented
 */
VOID
NTAPI
IoWriteErrorLogEntry(IN PVOID ElEntry)
{
    PERROR_LOG_ENTRY LogEntry;
    KIRQL Irql;

    /* Get the main header */
    LogEntry = (PERROR_LOG_ENTRY)((ULONG_PTR)ElEntry -
                                  sizeof(ERROR_LOG_ENTRY));

    /* Get time stamp */
    KeQuerySystemTime(&LogEntry->TimeStamp);

    /* Acquire the lock and insert this write in the list */
    KeAcquireSpinLock(&IopLogListLock, &Irql);
    InsertHeadList(&IopErrorLogListHead, &LogEntry->ListEntry);

    /* Check if the worker is running */
    if (!IopLogWorkerRunning)
    {
#if 0
        /* It's not, initialize it and queue it */
        ExInitializeWorkItem(&IopErrorLogWorkItem,
                             IopLogWorker,
                             &IopErrorLogWorkItem);
        ExQueueWorkItem(&IopErrorLogWorkItem, DelayedWorkQueue);
        IopLogWorkerRunning = TRUE;
#endif
    }

    /* Release the lock and return */
    KeReleaseSpinLock(&IopLogListLock, Irql);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:37,代码来源:error.c

示例9: AFSTagInitialLogEntry

void
AFSTagInitialLogEntry()
{

    LARGE_INTEGER liTime, liLocalTime;
    TIME_FIELDS timeFields;

    KeQuerySystemTime( &liTime);

    ExSystemTimeToLocalTime( &liTime,
                             &liLocalTime);

    RtlTimeToTimeFields( &liLocalTime,
                         &timeFields);

    AFSDbgLogMsg( 0,
                  0,
                  "AFS Log Initialized %d-%d-%d %d:%d Level %d Subsystems %08lX\n",
                  timeFields.Month,
                  timeFields.Day,
                  timeFields.Year,
                  timeFields.Hour,
                  timeFields.Minute,
                  AFSTraceLevel,
                  AFSTraceComponent);

    return;
}
开发者ID:jisqyv,项目名称:openafs,代码行数:28,代码来源:AFSLogSupport.cpp

示例10: USBPcapInitializePcapHeader

__inline static VOID
USBPcapInitializePcapHeader(PUSBPCAP_ROOTHUB_DATA pData,
                            pcaprec_hdr_t *pcapHeader,
                            UINT32 bytes)
{
    LARGE_INTEGER  time;

    /*
     * Updated approximately every ten milliseconds.
     *
     * TODO: Get higer precision timestamp.
     */
    KeQuerySystemTime(&time);

    pcapHeader->ts_sec = (UINT32)(time.QuadPart/10000000-11644473600);
    pcapHeader->ts_usec = (UINT32)((time.QuadPart%10000000)/10);

    /* Obey the snaplen limit */
    if (bytes > pData->snaplen)
    {
        pcapHeader->incl_len = pData->snaplen;
    }
    else
    {
        pcapHeader->incl_len = bytes;
    }
    pcapHeader->orig_len = bytes;
}
开发者ID:jue-jiang,项目名称:usbpcap,代码行数:28,代码来源:USBPcapBuffer.c

示例11: SpyLogPreOperationData

VOID
SpyLogPreOperationData (
    _Inout_ PRECORD_LIST RecordList
    )
/*++

Routine Description:

    This is called from the pre-operation callback routine to copy the
    necessary information into the log record.

    NOTE:  This code must be NON-PAGED because it can be called on the
           paging path.

Arguments:

    Data - The Data structure that contains the information we want to record.

    FltObjects - Pointer to the io objects involved in this operation.

    RecordList - Where we want to save the data

Return Value:

    None.

--*/
{
    PRECORD_DATA recordData = &RecordList->LogRecord.Data;

	recordData->Flags			= 0L;
    recordData->ProcessId       = (FILE_ID)PsGetCurrentProcessId();

    KeQuerySystemTime( &recordData->OriginatingTime );
}
开发者ID:CenterDevice,项目名称:MiniFSWatcher,代码行数:35,代码来源:mspyLib.c

示例12: sys_init

void
sys_init(void)
{   
    KeInitializeSpinLock(&ThreadListLock);
    InitializeListHead(&ThreadListHead);
    
    KeQuerySystemTime(&StartTime);
    
    KeInitializeEvent(&TerminationEvent, NotificationEvent, FALSE);
    
    ExInitializeNPagedLookasideList(&MessageLookasideList,
                                    NULL,
                                    NULL,
                                    0,
                                    sizeof(struct lwip_callback_msg),
                                    LWIP_MESSAGE_TAG,
                                    0);
    
    ExInitializeNPagedLookasideList(&QueueEntryLookasideList,
                                    NULL,
                                    NULL,
                                    0,
                                    sizeof(QUEUE_ENTRY),
                                    LWIP_QUEUE_TAG,
                                    0);
}
开发者ID:GYGit,项目名称:reactos,代码行数:26,代码来源:sys_arch.c

示例13: SetPhotoFrameRate

//
//  Set the interval between frames here.
//
NTSTATUS
CImageHardwareSimulation::
SetPhotoFrameRate(
    _In_    ULONGLONG TimePerFrame
)
{
    PAGED_CODE();

    //  Prevent state-changes during this call.
    KScopedMutex    Lock(m_ListLock);

    m_TimePerFrame = TimePerFrame;

    //
    // Reschedule the timer if the hardware isn't being stopped.
    //
    if( m_PinState == PinRunning )  // && !m_StopHardware )
    {
        //  First restart our start time.  We can't use the old time.
        KeQuerySystemTime( &m_StartTime );

        //
        // Reschedule the timer for the next interrupt time.
        //
        m_StartTime.QuadPart += m_TimePerFrame;
        m_InterruptTime = 0;

        m_IsrTimer.Set( m_StartTime );
    }
    return STATUS_SUCCESS;
}
开发者ID:Wesley-Lin,项目名称:Windows-driver-samples,代码行数:34,代码来源:imagehwsim.cpp

示例14: natbFwSessionCreate

BOOLEAN 
	natbFwSessionCreate(
		IN PFILTER_COMMON_CONTROL_BLOCK pAdapter,
		IN ULONG srcIpAddr,
		IN ULONG dstIpAddr,
		IN USHORT srcPort,
		IN USHORT dstPort,
		IN ULONG bOutgoing,
		IN UCHAR uProto
	)
{
	NDIS_SPIN_LOCK	*pSessionLock;
	PLIST_ENTRY		pSessionList;
	ULONG uHashindex;
	BOOLEAN bOk = FALSE;
	FLT_FW_SESSION *pFwSess;

	uHashindex = FLT_FW_SESSION_HASH_VALUE(
		srcIpAddr, 
		srcPort,
		dstIpAddr,
		dstPort);

	pSessionLock = pAdapter->FwSessionLocks + uHashindex;
	pSessionList = pAdapter->FwSessionList + uHashindex;

	pFwSess = ExAllocatePoolWithTag(0, sizeof(FLT_FW_SESSION), 'sF1N');
	ASSERT(pFwSess);
	if(NULL == pFwSess){
		return FALSE;
	}

	memset(pFwSess, 0, sizeof(*pFwSess));

	pFwSess->state = SESSION_STATE_SYN_RCV;
	pFwSess->protocol = uProto;
	pFwSess->out = bOutgoing;
	pFwSess->dstIpAddr = dstIpAddr;
	pFwSess->srcIpAddr = srcIpAddr;
	pFwSess->srcPort = srcPort;
	pFwSess->dstPort = dstPort;

	if(g_LogPktPass || g_LogPktDrop)
		natvLogSession("FIREWALL", pFwSess, SESSION_STATE_UNKNOWN, "created");

	KeQuerySystemTime ( &pFwSess->UpdateTime );

	NdisAcquireSpinLock(&g_FwSessionLock);

	NdisAcquireSpinLock(pSessionLock);
	InsertTailList(pSessionList, &pFwSess->ListEntry);
	InsertTailList(&g_FwSessionList, &pFwSess->GlobalEntry);
	pFwSess->pAdapter = pAdapter;
	NdisReleaseSpinLock(pSessionLock);

	NdisReleaseSpinLock(&g_FwSessionLock);

	return TRUE;
}
开发者ID:layerfsd,项目名称:natflt,代码行数:59,代码来源:firewall.c

示例15: time

/*
 * With 64 bits, we can cover about 583 years at a nanosecond resolution.
 * Windows counts time from 1601 so we do have about 100 years before we
 * overflow.
 */
static unsigned long long time(void)
{
	LARGE_INTEGER li;

	KeQuerySystemTime(&li);

        return li.QuadPart*100;
}
开发者ID:alanSummers,项目名称:lkl-linux-2.6,代码行数:13,代码来源:ntk.c


注:本文中的KeQuerySystemTime函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。