#include "dpsp.h" #define REGISTRY_NAMELEN 512 // space (in bytes) for a human readable (unicode) guid + some extra #define GUID_STRING_SIZE 80 #define SZ_SP_KEY "Software\\Microsoft\\DirectPlay\\Service Providers" #define SZ_GUID "Guid" #define SZ_FLAGS "dwFlags" #undef DPF_MODNAME #define DPF_MODNAME "FindApplicationInRegistry" // convert a hex char to an int - used by str to guid conversion // we wrote our own, since the ole one is slow, and requires ole32.dll // we use ansi strings here, since guids won't get internationalized int GetDigit(LPSTR lpstr) { char ch = *lpstr; if (ch >= '0' && ch <= '9') return(ch - '0'); if (ch >= 'a' && ch <= 'f') return(ch - 'a' + 10); if (ch >= 'A' && ch <= 'F') return(ch - 'A' + 10); return(0); } // walk the string, writing pairs of bytes into the byte stream (guid) // we need to write the bytes into the byte stream from right to left // or left to right as indicated by fRightToLeft void ConvertField(LPBYTE lpByte,LPSTR * ppStr,int iFieldSize,BOOL fRightToLeft) { int i; for (i=0;i