1998-10-11 19:04:17 +02:00
|
|
|
/*
|
|
|
|
* IMAGEHLP library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
|
|
|
*/
|
|
|
|
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winbase.h"
|
1998-10-11 19:04:17 +02:00
|
|
|
#include "winerror.h"
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
1999-05-14 10:17:14 +02:00
|
|
|
#include "debugtools.h"
|
1998-10-11 19:04:17 +02:00
|
|
|
#include "imagehlp.h"
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* InitializeListHead32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
VOID InitializeListHead(PLIST_ENTRY pListHead)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pListHead->Flink = pListHead;
|
|
|
|
pListHead->Blink = pListHead;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* InsertHeadList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
VOID InsertHeadList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pEntry->Blink = pListHead;
|
|
|
|
pEntry->Flink = pListHead->Flink;
|
|
|
|
pListHead->Flink = pEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* InsertTailList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
VOID InsertTailList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pEntry->Flink = pListHead;
|
|
|
|
pEntry->Blink = pListHead->Blink;
|
|
|
|
pListHead->Blink = pEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsListEmpty32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOLEAN IsListEmpty(PLIST_ENTRY pListHead)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
return !pListHead;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PopEntryList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
PSINGLE_LIST_ENTRY PopEntryList(PSINGLE_LIST_ENTRY pListHead)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pListHead->Next = NULL;
|
|
|
|
return pListHead;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PushEntryList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
VOID PushEntryList(
|
|
|
|
PSINGLE_LIST_ENTRY pListHead, PSINGLE_LIST_ENTRY pEntry)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pEntry->Next=pListHead;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RemoveEntryList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
VOID RemoveEntryList(PLIST_ENTRY pEntry)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
pEntry->Flink->Blink = pEntry->Blink;
|
|
|
|
pEntry->Blink->Flink = pEntry->Flink;
|
|
|
|
pEntry->Flink = NULL;
|
|
|
|
pEntry->Blink = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RemoveHeadList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
PLIST_ENTRY RemoveHeadList(PLIST_ENTRY pListHead)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
PLIST_ENTRY p = pListHead->Flink;
|
1998-10-11 19:04:17 +02:00
|
|
|
|
|
|
|
if(p != pListHead)
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
RemoveEntryList(pListHead);
|
1998-10-11 19:04:17 +02:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pListHead->Flink = NULL;
|
|
|
|
pListHead->Blink = NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RemoveTailList32
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
PLIST_ENTRY RemoveTailList(PLIST_ENTRY pListHead)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
RemoveHeadList(pListHead->Blink);
|
1998-10-11 19:04:17 +02:00
|
|
|
if(pListHead != pListHead->Blink)
|
|
|
|
return pListHead;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|