⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isoch.c

📁 winddk src目录下的WDM源码压缩!
💻 C
📖 第 1 页 / 共 5 页
字号:
} // w1394_IsochDetachBuffers

INT_PTR CALLBACK
IsochFreeBandwidthDlgProc(
    HWND        hDlg,
    UINT        uMsg,
    WPARAM      wParam,
    LPARAM      lParam
    )
{
    static PHANDLE      pHandle;
    static CHAR         tmpBuff[STRING_SIZE];

    switch (uMsg) {

        case WM_INITDIALOG:

            pHandle = (PHANDLE)lParam;

            // put offset low and high and buffer length in edit controls
            sprintf (tmpBuff, "%p", pHandle);
            SetDlgItemText(hDlg, IDC_ISOCH_FREE_BW_HANDLE, tmpBuff);

            return(TRUE); // WM_INITDIALOG

        case WM_COMMAND:

            switch (LOWORD(wParam)) {

                case IDOK:

                    GetDlgItemText(hDlg, IDC_ISOCH_FREE_BW_HANDLE, tmpBuff, STRING_SIZE);
                    if (!sscanf (tmpBuff, "%p", pHandle))
                    {
                        // failed to get the handle, just return here
                        EndDialog(hDlg, TRUE);
                        return FALSE;
                    }

                    EndDialog(hDlg, TRUE);
                    return(TRUE); // IDOK

                case IDCANCEL:
                    EndDialog(hDlg, FALSE);
                    return(TRUE); // IDCANCEL

                default:
                    return(TRUE); // default

            } // switch

            break; // WM_COMMAND

        default:
            break; // default

    } // switch

    return(FALSE);
} // IsochFreeBandwidthDlgProc

void
w1394_IsochFreeBandwidth(
    HWND    hWnd,
    PSTR    szDeviceName
    )
{
    HANDLE      hBandwidth;
    DWORD       dwRet;

    TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochFreeBandwidth\r\n"));

    hBandwidth = NULL;

    if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
                        "IsochFreeBandwidth",
                        hWnd,
                        IsochFreeBandwidthDlgProc,
                        (LPARAM)&hBandwidth
                        )) {

        dwRet = IsochFreeBandwidth( hWnd,
                                    szDeviceName,
                                    hBandwidth
                                    );
    }

    TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochFreeBandwidth\r\n"));
    return;
} // w1394_IsochFreeBandwidth

INT_PTR CALLBACK
IsochFreeChannelDlgProc(
    HWND        hDlg,
    UINT        uMsg,
    WPARAM      wParam,
    LPARAM      lParam
    )
{
    static PULONG       pChannel;
    static CHAR         tmpBuff[STRING_SIZE];

    switch (uMsg) {

        case WM_INITDIALOG:

            pChannel = (PULONG)lParam;

            // put offset low and high and buffer length in edit controls
            _ultoa(*pChannel, tmpBuff, 16);
            SetDlgItemText(hDlg, IDC_ISOCH_FREE_CHAN_CHANNEL, tmpBuff);

            return(TRUE); // WM_INITDIALOG

        case WM_COMMAND:

            switch (LOWORD(wParam)) {

                case IDOK:

                    GetDlgItemText(hDlg, IDC_ISOCH_FREE_CHAN_CHANNEL, tmpBuff, STRING_SIZE);
                    *pChannel = strtoul(tmpBuff, NULL, 16);

                    EndDialog(hDlg, TRUE);
                    return(TRUE); // IDOK

                case IDCANCEL:
                    EndDialog(hDlg, FALSE);
                    return(TRUE); // IDCANCEL

                default:
                    return(TRUE); // default

            } // switch

            break; // WM_COMMAND

        default:
            break; // default

    } // switch

    return(FALSE);
} // IsochFreeChannelDlgProc

void
w1394_IsochFreeChannel(
    HWND    hWnd,
    PSTR    szDeviceName
    )
{
    ULONG       nChannel;
    DWORD       dwRet;

    TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochFreeChannel\r\n"));

    nChannel = 0;

    if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
                        "IsochFreeChannel",
                        hWnd,
                        IsochFreeChannelDlgProc,
                        (LPARAM)&nChannel
                        )) {

        dwRet = IsochFreeChannel( hWnd,
                                  szDeviceName,
                                  nChannel
                                  );
    }

    TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochFreeChannel\r\n"));
    return;
} // w1394_IsochFreeChannel

INT_PTR CALLBACK
IsochFreeResourcesDlgProc(
    HWND        hDlg,
    UINT        uMsg,
    WPARAM      wParam,
    LPARAM      lParam
    )
{
    static PHANDLE      phResource;
    static CHAR         tmpBuff[STRING_SIZE];

    switch (uMsg) {

        case WM_INITDIALOG:

            phResource = (HANDLE)lParam;

            sprintf (tmpBuff, "%p", *phResource);
            SetDlgItemText(hDlg, IDC_FREE_RES_RESOURCE_HANDLE, tmpBuff);

            return(TRUE); // WM_INITDIALOG

        case WM_COMMAND:

            switch (LOWORD(wParam)) {

                case IDOK:

                    GetDlgItemText(hDlg, IDC_FREE_RES_RESOURCE_HANDLE, tmpBuff, STRING_SIZE);
                    if (!sscanf (tmpBuff, "%p", phResource))
                    {
                        // failed to get the handle, just return here
                        EndDialog(hDlg, TRUE);
                        return FALSE;
                    }

                    EndDialog(hDlg, TRUE);
                    return(TRUE); // IDOK

                case IDCANCEL:
                    EndDialog(hDlg, FALSE);
                    return(TRUE); // IDCANCEL

                default:
                    return(TRUE); // default

            } // switch

            break; // WM_COMMAND

        default:
            break; // default

    } // switch

    return(FALSE);
} // IsochFreeResourcesDlgProc

void
w1394_IsochFreeResources(
    HWND    hWnd,
    PSTR    szDeviceName
    )
{
    HANDLE      hResource;
    DWORD       dwRet;

    TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochFreeResources\r\n"));

    hResource = NULL;

    if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
                        "IsochFreeResources",
                        hWnd,
                        IsochFreeResourcesDlgProc,
                        (LPARAM)&hResource
                        )) {

        dwRet = IsochFreeResources( hWnd,
                                    szDeviceName,
                                    hResource
                                    );
    }

    TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochFreeResources\r\n"));
    return;
} // w1394_IsochFreeResources

INT_PTR CALLBACK
IsochListenDlgProc(
    HWND        hDlg,
    UINT        uMsg,
    WPARAM      wParam,
    LPARAM      lParam
    )
{
    static PISOCH_LISTEN    pIsochListen;
    static CHAR             tmpBuff[STRING_SIZE];

    switch (uMsg) {

        case WM_INITDIALOG:

            pIsochListen = (PISOCH_LISTEN)lParam;

            sprintf (tmpBuff, "%p", pIsochListen->hResource);
            SetDlgItemText(hDlg, IDC_ISOCH_LISTEN_RESOURCE_HANDLE, tmpBuff);

            _ultoa(pIsochListen->StartTime.CL_CycleOffset, tmpBuff, 16);
            SetDlgItemText(hDlg, IDC_ISOCH_LISTEN_CYCLE_OFFSET, tmpBuff);

            _ultoa(pIsochListen->StartTime.CL_CycleCount, tmpBuff, 16);
            SetDlgItemText(hDlg, IDC_ISOCH_LISTEN_CYCLE_COUNT, tmpBuff);

            _ultoa(pIsochListen->StartTime.CL_SecondCount, tmpBuff, 16);
            SetDlgItemText(hDlg, IDC_ISOCH_LISTEN_SECOND_COUNT, tmpBuff);

            return(TRUE); // WM_INITDIALOG

        case WM_COMMAND:

            switch (LOWORD(wParam)) {

                case IDOK:

                    GetDlgItemText(hDlg, IDC_ISOCH_LISTEN_RESOURCE_HANDLE, tmpBuff, STRING_SIZE);
                    if (!sscanf (tmpBuff, "%p", &(pIsochListen->hResource)))
                    {
                        // failed to get the handle, just return here
                        EndDialog(hDlg, TRUE);
                        return FALSE;
                    }

                    GetDlgItemText(hDlg, IDC_ISOCH_LISTEN_CYCLE_OFFSET, tmpBuff, STRING_SIZE);
                    pIsochListen->StartTime.CL_CycleOffset = strtoul(tmpBuff, NULL, 16);

                    GetDlgItemText(hDlg, IDC_ISOCH_LISTEN_CYCLE_COUNT, tmpBuff, STRING_SIZE);
                    pIsochListen->StartTime.CL_CycleCount = strtoul(tmpBuff, NULL, 16);

                    GetDlgItemText(hDlg, IDC_ISOCH_LISTEN_SECOND_COUNT, tmpBuff, STRING_SIZE);
                    pIsochListen->StartTime.CL_SecondCount = strtoul(tmpBuff, NULL, 16);

                    EndDialog(hDlg, TRUE);
                    return(TRUE); // IDOK

                case IDCANCEL:
                    EndDialog(hDlg, FALSE);
                    return(TRUE); // IDCANCEL

                default:
                    return(TRUE); // default

            } // switch

            break; // WM_COMMAND

        default:
            break; // default

    } // switch

    return(FALSE);
} // IsochListenDlgProc

void
w1394_IsochListen(
    HWND    hWnd,
    PSTR    szDeviceName
    )
{
    ISOCH_LISTEN    isochListen;
    DWORD           dwRet;

    TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochListen\r\n"));

    isochListen.hResource = NULL;
    isochListen.fulFlags = 0;
    isochListen.StartTime.CL_CycleOffset = 0;
    isochListen.StartTime.CL_CycleCount = 0;
    isochListen.StartTime.CL_SecondCount = 0;

    if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
                        "IsochListen",

⌨️ 快捷键说明

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