All pastes #341735 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-05 21:02 UTC
rendered paste body
struct ltguid
{
	bool operator () (const GUID lguid, const GUID rguid) const
	{	
		tostringstream ostr1,ostr2;
		tstring str1,str2;
		ostr1 << hex << lguid.Data1 << _T("-")
			 << hex << lguid.Data2 << _T("-")
			 << hex << lguid.Data3 << _T("-")
			 << hex << lguid.Data4;
		
		ostr2 << hex << rguid.Data1 << _T("-")
			 << hex << rguid.Data2 << _T("-")
			 << hex << rguid.Data3 << _T("-")
			 << hex << rguid.Data4;
		
		str1 = ostr1.str();
		str2 = ostr2.str();
		int s12 = _tcscmp(str1.c_str(),str2.c_str());

		return (s12 < 0);
	}
};

typedef std::map<GUID, CreateDeviceObjectCallback, ltguid> CallbackMap;