• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ KeQuerySystemTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: sys_now

u32_t sys_now(void)
{
    LARGE_INTEGER CurrentTime;
    
    KeQuerySystemTime(&CurrentTime);
    
    return (CurrentTime.QuadPart - StartTime.QuadPart) / 10000;
}
开发者ID:GYGit,项目名称:reactos,代码行数:8,代码来源:sys_arch.c


示例17: GetTheCurrentTime

/*****************************************************************************
 * GetTheCurrentTime()
 *****************************************************************************
 * Get the current time, in milliseconds (KeQuerySystemTime returns units of
 * 100ns each).
 */
ULONG GetTheCurrentTime()
{
    LARGE_INTEGER Time;

    KeQuerySystemTime(&Time);

    return (ULONG)(Time.QuadPart / (10 * 1000));
}
开发者ID:340211173,项目名称:Driver,代码行数:14,代码来源:kernhelp.cpp


示例18: GA_TimerRead

/****************************************************************************
REMARKS:
This function reads the high resolution timer.
****************************************************************************/
void NAPI GA_TimerRead(
    GA_largeInteger *value)
{
    if (haveRDTSC)
        _GA_readTimeStamp(value);
    else
        KeQuerySystemTime((LARGE_INTEGER*)value);
}
开发者ID:kendallb,项目名称:scitech-mgl,代码行数:12,代码来源:gantdrv.c


示例19: change_file_info_func

static void change_file_info_func(void *data, VOID *buffer, ULONG len)
{
	struct fuse_attr *attr = (struct fuse_attr *)data;
	FILE_BASIC_INFORMATION *fbi = (FILE_BASIC_INFORMATION *)buffer;

	fbi->LastAccessTime = unix_time_to_windows_time(attr->atime);
	fbi->LastWriteTime = unix_time_to_windows_time(attr->mtime);
	KeQuerySystemTime(&fbi->ChangeTime);
}
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:9,代码来源:fileio.c


示例20: FatGetCurrentFatTime

FAT_TIME_STAMP
FatGetCurrentFatTime (
    IN PIRP_CONTEXT IrpContext
    )

/*++

Routine Description:

    This routine returns the current system time in Fat time

Arguments:

Return Value:

    FAT_TIME_STAMP - Receives the current system time

--*/

{
    LARGE_INTEGER Time;
    TIME_FIELDS TimeFields;
    FAT_TIME_STAMP FatTime;

    //
    //  Get the current system time, and map it into a time field record.
    //

    KeQuerySystemTime( &Time );

    ExSystemTimeToLocalTime( &Time, &Time );

    //
    //  Always add almost two seconds to round up to the nearest double second.
    //

    Time.QuadPart = Time.QuadPart + AlmostTwoSeconds;

    (VOID)RtlTimeToTimeFields( &Time, &TimeFields );

    //
    //  Now simply copy over the information
    //

    FatTime.Time.DoubleSeconds = (USHORT)(TimeFields.Second / 2);
    FatTime.Time.Minute        = (USHORT)(TimeFields.Minute);
    FatTime.Time.Hour          = (USHORT)(TimeFields.Hour);

    FatTime.Date.Year          = (USHORT)(TimeFields.Year - 1980);
    FatTime.Date.Month         = (USHORT)(TimeFields.Month);
    FatTime.Date.Day           = (USHORT)(TimeFields.Day);

    UNREFERENCED_PARAMETER( IrpContext );

    return FatTime;
}
开发者ID:bekdepostan,项目名称:hf-2011,代码行数:56,代码来源:timesup.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KeQueryTickCount函数代码示例发布时间:2022-05-30
下一篇:
C++ KeLowerIrql函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap