sdenum.h

来自「SAMSUNG S3C6410 CPU BSP for winmobile6」· C头文件 代码 · 共 69 行

H
69
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//

#ifndef _SDENUM_H_
#define _SDENUM_H_

#include <SDCardDDK.h>
#include <DefBus.h>


#define DEFAULT_SD_BUS_NAME _T("SDCARD")

struct SDCARD_DEVICE_CONTEXT;


class CSdDeviceFolder : public DeviceFolder {
public:
    CSdDeviceFolder(LPCTSTR pszBusName, LPCTSTR pszTemplateRegPath, 
        SDCARD_DEVICE_CONTEXT *pDevice,
        DWORD dwBusType, DWORD dwBusNumber, PCI_SLOT_NUMBER SlotNumber, 
        HANDLE hParent, DWORD dwInitReg);
    virtual ~CSdDeviceFolder() {}

    CEDEVICE_POWER_STATE GetPowerState();
    BOOL SetPowerState(CEDEVICE_POWER_STATE cpsNew);

private:
    SDCARD_DEVICE_CONTEXT *m_pDevice;
};


class CSdBusEnum : public DefaultBusDriver {
public:
    CSdBusEnum(LPCTSTR pszActiveRegPath);
    virtual ~CSdBusEnum();
    virtual BOOL Init();

    virtual DWORD GetBusNamePrefix(LPTSTR pszReturnBusName, DWORD cchReturnBusName);

    virtual SD_API_STATUS ActivateChild(LPCTSTR pszChildDeviceKey, DWORD dwHCNumber,
        DWORD dwSlotNumber, DWORD dwFunctionNumber, SDCARD_DEVICE_CONTEXT *pDevice,
        CSdDeviceFolder **ppDeviceFolder);

    virtual SD_API_STATUS DeactivateChild(CSdDeviceFolder *pDeviceFolder);

    virtual BOOL IOControl(DWORD dwCode, PBYTE pBufIn, DWORD dwLenIn, 
        PBYTE pBufOut, DWORD dwLenOut, PDWORD pdwActualOut);

    BOOL SetBusName(LPCTSTR pszBusName);

private:
    LPCTSTR GetBusName();

    LPTSTR m_pszBusName;
};

#endif // _SDENUM_H_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?