WDK/DDK USBVIEW 源码 VC2010编译环境 内含编译环境设置


琢磨了很久 终于搞定了 WDK7.1 下面的范例 我修改为在VC2010编译,内含编译环境设置供大家分享!
资源截图
代码片段和文件信息
/*++

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-03-08 03:39  usbview_VS10
     文件        1846  2010-01-13 22:32  usbview_VS10ang.ico
     文件        4171  2010-02-08 18:26  usbview_VS10debug.c
     文件        4397  2010-02-08 18:26  usbview_VS10devnode.c
     文件       34534  2010-02-08 18:26  usbview_VS10dispaud.c
     文件       38076  2010-02-08 18:26  usbview_VS10display.c
     文件       68682  2010-02-08 18:26  usbview_VS10enum.c
     文件         766  2010-01-13 22:32  usbview_VS10hub.ico
     目录           0  2012-03-08 00:48  usbview_VS10ipch
     目录           0  2012-03-08 00:48  usbview_VS10ipchusbview_vs10-9ea7f94e
     文件    33488896  2012-03-08 00:48  usbview_VS10ipchusbview_vs10-9ea7f94eusbview_vs10-f6154151.ipch
     文件        1090  2010-02-08 18:26  usbview_VS10makefile
     文件        1060  2010-02-08 18:26  usbview_VS10makefile.mk
     文件       10134  2010-01-13 22:32  usbview_VS10monitor.ico
     文件         766  2010-01-13 22:32  usbview_VS10port.ico
     文件         978  2010-02-08 18:26  usbview_VS10
esource.h
     文件         978  2010-02-08 18:26  usbview_VS10sources
     文件         326  2010-01-13 22:32  usbview_VS10split.cur
     文件         766  2010-01-13 22:32  usbview_VS10usb.ico
     文件        9258  2010-02-08 18:26  usbview_VS10usbdesc.h
     文件       23351  2010-02-08 18:26  usbview_VS10usbview.c
     文件        7797  2010-02-08 18:26  usbview_VS10usbview.h
     文件       19985  2010-02-08 18:26  usbview_VS10usbview.htm
     文件        3339  2012-03-08 01:03  usbview_VS10usbview.rc
     目录           0  2012-03-08 03:14  usbview_VS10usbview_VS10
     文件    24793088  2012-03-08 03:39  usbview_VS10usbview_VS10.sdf
     文件          53  2012-03-08 03:37  usbview_VS10usbview_VS10.SearchResults
     文件        1395  2012-03-08 02:51  usbview_VS10usbview_VS10.sln
     文件       13312  2012-03-08 03:39  usbview_VS10usbview_VS10.suo
     文件       24071  2012-03-08 03:37  usbview_VS10usbview_VS10.WK3
     文件        8011  2012-03-08 03:36  usbview_VS10usbview_VS10usbview_VS10.vcxproj
............此处省略74个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)