示例#1
0
// Check whether the Cedar was build after the specified date
bool IsLaterBuild(CEDAR *c, UINT64 t)
{
	SYSTEMTIME sb, st;
	UINT64 b;
	// Validate arguments
	if (c == NULL)
	{
		return false;
	}

	Zero(&sb, sizeof(sb));
	Zero(&st, sizeof(st));

	UINT64ToSystem(&sb, c->BuiltDate);
	UINT64ToSystem(&st, t);

	// Ignore time of the day
	sb.wHour = sb.wMinute = sb.wSecond = sb.wMilliseconds = 0;
	st.wHour = st.wMinute = st.wSecond = st.wMilliseconds = 0;

	b = SystemToUINT64(&sb);
	t = SystemToUINT64(&st);

	if (b > t)
	{
		return true;
	}
	else
	{
		return false;
	}
}
示例#2
0
// オブジェクトのサマリーの表示
void PrintObjectList(TRACKING_OBJECT *o)
{
    char tmp[MAX_SIZE];
    SYSTEMTIME t;
    UINT64ToSystem(&t, o->CreatedDate);
    GetTimeStrMilli(tmp, sizeof(tmp), &t);
    TrackGetObjSymbolInfo(o);
    Print("%-4u - [%-6s] %s 0x%p size=%-5u %11s %u\n",
          o->Id, o->Name, tmp, UINT64_TO_POINTER(o->Address), o->Size, o->FileName, o->LineNumber);
}
示例#3
0
// オブジェクト情報の表示
void PrintObjectInfo(TRACKING_OBJECT *o)
{
    SYSTEMTIME t;
    char tmp[MAX_SIZE];
    // 引数チェック
    if (o == NULL)
    {
        return;
    }

    UINT64ToSystem(&t, o->CreatedDate);
    GetDateTimeStrMilli(tmp, sizeof(tmp), &t);

    Print("    TRACKING_OBJECT ID: %u\n"
          "  TRACKING_OBJECT TYPE: %s\n"
          "      ADDRESS: 0x%p\n"
          "  TRACKING_OBJECT SIZE: %u bytes\n"
          " CREATED DATE: %s\n",
          o->Id, o->Name, UINT64_TO_POINTER(o->Address), o->Size, tmp);

    PrintCallStack(o->CallStack);
}
示例#4
0
// Convert the 64 bit time to the CK_DATE
void UINT64ToCkDate(void *p_ck_date, UINT64 time64)
{
	SYSTEMTIME st;
	char year[32], month[32], day[32];
	struct CK_DATE *ck_date = (CK_DATE *)p_ck_date;
	// Validate arguments
	if (ck_date == NULL)
	{
		return;
	}

	UINT64ToSystem(&st, time64);

	Format(year, sizeof(year), "%04u", st.wYear);
	Format(month, sizeof(month), "%04u", st.wMonth);
	Format(day, sizeof(day), "%04u", st.wDay);

	Zero(ck_date, sizeof(CK_DATE));

	Copy(ck_date->year, year, 4);
	Copy(ck_date->month, month, 2);
	Copy(ck_date->day, day, 2);
}