st/nine: Print GUID instead of pointer

To ease debugging print the GUID instead of the pointer to it.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
Patrick Rudolph 2015-11-14 12:59:46 +01:00 committed by Axel Davy
parent 2a4d1509c8
commit 5c79bd666b
3 changed files with 30 additions and 6 deletions

View File

@ -20,6 +20,7 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <stdio.h>
#include "guid.h"
const GUID IID_IUnknown = { 0x00000000, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
@ -64,3 +65,20 @@ GUID_equal( const GUID *a,
}
return TRUE;
}
char* GUID_sprintf(char *guid_str, REFGUID id) {
sprintf( guid_str,
"{%08X,%04X,%04X,%02X%02X%02X%02X%02X%02X%02X%02X}",
id->Data1,
id->Data2,
id->Data3,
id->Data4[0],
id->Data4[1],
id->Data4[2],
id->Data4[3],
id->Data4[4],
id->Data4[5],
id->Data4[6],
id->Data4[7]);
return guid_str;
}

View File

@ -33,4 +33,8 @@ boolean
GUID_equal( const GUID *a,
const GUID *b );
char*
GUID_sprintf( char *guid_str,
REFGUID id );
#endif /* _NINE_GUID_H_ */

View File

@ -34,7 +34,6 @@
#define DBG_CHANNEL DBG_RESOURCE
HRESULT
NineResource9_ctor( struct NineResource9 *This,
struct NineUnknownParams *pParams,
@ -117,9 +116,10 @@ NineResource9_SetPrivateData( struct NineResource9 *This,
enum pipe_error err;
struct pheader *header;
const void *user_data = pData;
char guid_str[64];
DBG("This=%p refguid=%p pData=%p SizeOfData=%u Flags=%x\n",
This, refguid, pData, SizeOfData, Flags);
DBG("This=%p GUID=%s pData=%p SizeOfData=%u Flags=%x\n",
This, GUID_sprintf(guid_str, refguid), pData, SizeOfData, Flags);
if (Flags & D3DSPD_IUNKNOWN)
user_assert(SizeOfData == sizeof(IUnknown *), D3DERR_INVALIDCALL);
@ -162,9 +162,10 @@ NineResource9_GetPrivateData( struct NineResource9 *This,
{
struct pheader *header;
DWORD sizeofdata;
char guid_str[64];
DBG("This=%p refguid=%p pData=%p pSizeOfData=%p\n",
This, refguid, pData, pSizeOfData);
DBG("This=%p GUID=%s pData=%p pSizeOfData=%p\n",
This, GUID_sprintf(guid_str, refguid), pData, pSizeOfData);
header = util_hash_table_get(This->pdata, refguid);
if (!header) { return D3DERR_NOTFOUND; }
@ -191,8 +192,9 @@ NineResource9_FreePrivateData( struct NineResource9 *This,
REFGUID refguid )
{
struct pheader *header;
char guid_str[64];
DBG("This=%p refguid=%p\n", This, refguid);
DBG("This=%p GUID=%s\n", This, GUID_sprintf(guid_str, refguid));
header = util_hash_table_get(This->pdata, refguid);
if (!header)