Hi,

I'm getting an error while calling QueryPerformanceCounter and I don't know why.
Code:
LARGE_INTEGER start;
BOOL bRet = QueryPerformanceCounter(&start);

ASSERT(bRet);
if(FALSE == bRet)
{
   int nError = GetLastError();
   PrintError(nError);
}
The function returns FALSE, meaning it failed, but when I call GetLastError() it returns 0, meaning ERROR_SUCCES; there was no error...

However If I do this, it works just fine:
Code:
LARGE_INTEGER* start = new LARGE_INTEGER;
BOOL bRet = QueryPerformanceCounter(start);

ASSERT(bRet);
if(FALSE == bRet)
{
   int nError = GetLastError();
   PrintError(nError);
}

delete start;
LARGE_INTEGER looks like this:
Code:
typedef union union 
{  
  struct 
  {    
     DWORD LowPart;    
     LONG HighPart;  
  };  
   LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;
I'm working on WinXP, with VC6.0, SP6, and have an AthlonXP 1600+.

Why is the first code failing (with 0 returned by GetErrorSucces) and the second one is just ok?

Thanks.