#define TOTALBYTES    50000
#define BYTEINCREMENT 20000

struct _MWCOUNTER;
struct _QUERY;

typedef struct _QUERY {
	char QueryText[BFSZ];
	PPERF_DATA_BLOCK pData;
	int nDataBufSize;

	LARGE_INTEGER LastTime;		// should probably be LONGLONG
	LARGE_INTEGER LastTime100ns;	// should probably be LONGLONG
	LARGE_INTEGER TimeDelta;
	LARGE_INTEGER TimeDelta100ns;

	struct _MWCOUNTER *pPerfItems;
} QUERY,PQUERY;


typedef struct _MWCOUNTER {
	char* name;

	// Navigation helpers
	unsigned long ObjectIndex;
	char* InstanceName;
	unsigned long CounterIndex;

	// The important delta info (old data point)
	LARGE_INTEGER m_OldData;	// Shuould probably be LARGE_INTEGER

	QUERY* pQuery;
	struct _MWCOUNTER *next;
} MWCOUNTER;

typedef struct _RAWITEM {
	DWORD m_type;
	DWORD m_cbData;	
	PBYTE m_pData;
	PPERF_OBJECT_TYPE pObj;
} RAWITEM;

int CreateQuery(QUERY **hQuery);
int AddCounter(QUERY *pQuery, char* name, MWCOUNTER **hPerfItem);
int ReleaseQuery(QUERY *pQuery);
int CollectData(QUERY *pQuery);
int WindowsPerfCounter(MWCOUNTER *pPerfItem, /*value*/ double* numValue, char* strValue);
int WindowsPerfCounter_instances(MWCOUNTER *pPerfItem);
