資源簡介
WDK源碼中 usbView 例子的編譯及說明.
可參考文章: http://blog.csdn.net/chenyujing1234/article/details/7577320#comments

代碼片段和文件信息
/*++
Copyright?(c)?1997-1998?Microsoft?Corporation
Module?Name:
????DEBUG.C
Abstract:
????This?source?file?contains?debug?routines.
Environment:
????user?mode
Revision?History:
????07-08-97?:?created
--*/
//*****************************************************************************
//?I?N?C?L?U?D?E?S
//*****************************************************************************
#include?
#include?setyps.h>
#include?
#include?
#include?“usbview.h“
#if?DBG
//*****************************************************************************
//?T?Y?P?E?D?E?F?S
//*****************************************************************************
typedef?struct?_ALLOCHEADER
{
????LIST_ENTRY??ListEntry;
????PCTSTR???????File;
????ULONG???????Line;
}?ALLOCHEADER?*PALLOCHEADER;
//*****************************************************************************
//?G?L?O?B?A?L?S
//*****************************************************************************
LIST_ENTRY?AllocListHead?=
{
????&AllocListHead
????&AllocListHead
};
//*****************************************************************************
//
//?MyAlloc()
//
//*****************************************************************************
HGLOBAL
MyAlloc?(
????__in?PCTSTR?File
????ULONG???Line
????DWORD???dwBytes
)
{
????PALLOCHEADER?header;
????if?(dwBytes)
????{
????????dwBytes?+=?sizeof(ALLOCHEADER);
????????header?=?(PALLOCHEADER)GlobalAlloc(GPTR?dwBytes);
????????if?(header?!=?NULL)
????????{
????????????InsertTailList(&AllocListHead?&header->ListEntry);
????????????header->File?=?File;
????????????header->Line?=?Line;
????????????return?(HGLOBAL)(header?+?1);
????????}
????}
????return?NULL;
}
//*****************************************************************************
//
//?MyReAlloc()
//
//*****************************************************************************
HGLOBAL
MyReAlloc?(
????HGLOBAL?hMem
????DWORD???dwBytes
)
{
????PALLOCHEADER?header;
????PALLOCHEADER?headerNew;
????if?(hMem)
????{
????????header?=?(PALLOCHEADER)hMem;
????????header--;
????????//?Remove?the?old?address?from?the?allocation?list
????????//
????????RemoveEntryList(&header->ListEntry);
????????headerNew?=?GlobalReAlloc((HGLOBAL)header?dwBytes?GMEM_MOVEABLE|GMEM_ZEROINIT);
????????if?(headerNew?!=?NULL)
????????{
????????????//?Add?the?new?address?to?the?allocation?list
????????????//
????????????InsertTailList(&AllocListHead?&headerNew->ListEntry);
????????????return?(HGLOBAL)(headerNew?+?1);
????????}
????????else
????????{
????????????//?If?GlobalReAlloc?fails?the?original?memory?is?not?freed
????????????//?and?the?original?handle?and?pointer?are?still?valid.
????????????//?Add?the?old?address?back?to?the?allocation?list.
????????????//
????????????InsertTailList(&AllocListHead?&header->ListEntry)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-05-17?16:35??usbView\
?????文件????????1846??2010-01-13?22:32??usbView\bang.ico
?????目錄???????????0??2012-05-17?16:38??usbView\Debug\
?????文件????????4171??2010-02-08?18:26??usbView\debug.c
?????文件????????8896??2012-05-17?17:50??usbView\Debug\BuildLog.htm
?????文件???????14959??2012-05-17?17:37??usbView\Debug\debug.obj
?????文件???????18836??2012-05-17?17:37??usbView\Debug\devnode.obj
?????文件???????66890??2012-05-17?17:37??usbView\Debug\dispaud.obj
?????文件??????242106??2012-05-17?17:37??usbView\Debug\display.obj
?????文件???????60077??2012-05-17?17:37??usbView\Debug\enum.obj
?????文件??????????67??2012-05-17?17:50??usbView\Debug\mt.dep
?????文件????????6674??2012-05-17?16:42??usbView\Debug\RCa01236
?????文件????????6674??2012-05-17?16:41??usbView\Debug\RCa02136
?????文件????????6674??2012-05-17?16:39??usbView\Debug\RCa07960
?????文件??????139264??2012-05-17?17:50??usbView\Debug\usbView.exe
?????文件?????????387??2012-05-17?17:50??usbView\Debug\usbView.exe.intermediate.manifest
?????文件??????680448??2012-05-17?17:50??usbView\Debug\usbView.ilk
?????文件???????51560??2012-05-17?17:37??usbView\Debug\usbview.obj
?????文件??????683008??2012-05-17?17:50??usbView\Debug\usbView.pdb
?????文件???????16164??2012-05-17?17:50??usbView\Debug\usbview.res
?????文件??????281600??2012-05-17?17:37??usbView\Debug\vc80.idb
?????文件???????94208??2012-05-17?17:37??usbView\Debug\vc80.pdb
?????文件????????4362??2012-05-17?18:21??usbView\devnode.c
?????文件???????34534??2010-02-08?18:26??usbView\dispaud.c
?????文件???????38076??2010-02-08?18:26??usbView\display.c
?????文件???????68490??2012-05-17?18:16??usbView\enum.c
?????文件?????????766??2010-01-13?22:32??usbView\hub.ico
?????文件????????1060??2010-02-08?18:26??usbView\makefile.mk
?????文件???????10134??2010-01-13?22:32??usbView\monitor.ico
?????文件?????????766??2010-01-13?22:32??usbView\port.ico
?????文件????????6712??2012-05-17?16:37??usbView\RCa00668
............此處省略14個文件信息
- 上一篇:完整的HIS代碼 (醫院管理)
- 下一篇:FPGA VGA顯示圖片
評論
共有 條評論