예제 #1
0
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#include "precomp.h"

STRA::STRA(
    VOID
) : m_cchLen( 0 )
{
    *( QueryStr() ) = '\0';
}

STRA::STRA(
    __inout_ecount(cchInit) CHAR* pbInit,
    __in DWORD cchInit
) : m_Buff( pbInit, cchInit * sizeof( CHAR ) ),
    m_cchLen(0)
/*++
    Description:

        Used by STACK_STRA. Initially populates underlying buffer with pbInit.

        pbInit is not freed.

    Arguments:

        pbInit - initial memory to use
        cchInit - count, in characters, of pbInit

    Returns:
예제 #2
0
	__in		unsigned int completed,
	__inout		unsigned int *addedp);

	void
siena_tx_qdesc_dma_create(
	__in	efx_txq_t *etp,
	__in	efsys_dma_addr_t addr,
	__in	size_t size,
	__in	boolean_t eop,
	__out	efx_desc_t *edp);

#if EFSYS_OPT_QSTATS
static			void
siena_tx_qstats_update(
	__in				efx_txq_t *etp,
	__inout_ecount(TX_NQSTATS)	efsys_stat_t *stat);
#endif

#endif /* EFSYS_OPT_SIENA */


#if EFSYS_OPT_SIENA
static const efx_tx_ops_t	__efx_tx_siena_ops = {
	siena_tx_init,				/* etxo_init */
	siena_tx_fini,				/* etxo_fini */
	siena_tx_qcreate,			/* etxo_qcreate */
	siena_tx_qdestroy,			/* etxo_qdestroy */
	siena_tx_qpost,				/* etxo_qpost */
	siena_tx_qpush,				/* etxo_qpush */
	siena_tx_qpace,				/* etxo_qpace */
	siena_tx_qflush,			/* etxo_qflush */
예제 #3
0
//   moduleBaseAddress - base address of a module we should inspect
//   pVersion - output, the version of the CLR detected if this is a CLR
//   pdwDbiTimeStamp - the timestamp of DBI as embedded in the CLR image
//   pdwDbiSizeOfImage - the SizeOfImage of DBI as embedded in the CLR image
//   pDbiName - output, the filename of DBI (as calculated by this function but that might change)
//   dwDbiNameCharCount - input, the number of WCHARs in the buffer pointed to by pDbiName
//   pdwDacTimeStampe - the timestamp of DAC as embedded in the CLR image
//   pdwDacSizeOfImage - the SizeOfImage of DAC as embedded in the CLR image
//   pDacName - output, the filename of DAC (as calculated by this function but that might change)
//   dwDacNameCharCount - input, the number of WCHARs in the buffer pointed to by pDacName
HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget,
                                     ULONG64 moduleBaseAddress,
                                     CLR_DEBUGGING_VERSION* pVersion,
                                     DWORD* pdwDbiTimeStamp,
                                     DWORD* pdwDbiSizeOfImage,
                                     __out_z __inout_ecount(dwDbiNameCharCount) WCHAR* pDbiName,
                                     DWORD  dwDbiNameCharCount,
                                     DWORD* pdwDacTimeStamp,
                                     DWORD* pdwDacSizeOfImage,
                                     __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName,
                                     DWORD  dwDacNameCharCount)
{
#ifndef FEATURE_PAL
    WORD imageFileMachine = 0;
    DWORD resourceSectionRVA = 0;
    HRESULT hr = GetMachineAndResourceSectionRVA(pDataTarget, moduleBaseAddress, &imageFileMachine, &resourceSectionRVA);

    // We want the version resource which has type = RT_VERSION = 16, name = 1, language = 0x409
    DWORD versionResourceRVA = 0;
    DWORD versionResourceSize = 0;
    if(SUCCEEDED(hr))
예제 #4
0
        {                                                               \
            sPrint.Printf(sRes.GetUnicode(), err.fld);                  \
            sMessage += sPrint;                                         \
        }                                                               \
        else                                                            \
        {                                                               \
            SString s(SString::Ascii, VER_FAILED_TO_LOAD_RESOURCE_STRING); \
            sMessage += s;                                              \
        }                                                               \
    }

// Copies the error message to the input char*
WCHAR* Verifier::GetErrorMsg(
        HRESULT hrError,
        VerError err,
        __inout_ecount(len) WCHAR *wszMsg, 
        int len,
        ValidateWorkerArgs* pArgs)
{
    CONTRACTL {
        THROWS;
        GC_TRIGGERS;
    } CONTRACTL_END;

    SString sMessage;   // to debug, watch "(WCHAR*)sMessage.m_buffer"
    SString sPrint;
    LPCSTR  szMethodName;

    NewHolder<SourceLine> pSL(NULL);

    if (pArgs->pMethodDesc)
예제 #5
0
    //

    hr = SendControlTransferSynchronously(
                &(setupPacket.WinUsb),
                (PUCHAR) SwitchState,
                sizeof(SWITCH_STATE),
                &bytesReturned
                );

    return hr;
}

HRESULT
CMyDevice::SendControlTransferSynchronously(
    __in PWINUSB_SETUP_PACKET SetupPacket,
    __inout_ecount(BufferLength) PBYTE Buffer,
    __in ULONG BufferLength,
    __out PULONG LengthTransferred
    )
{
    HRESULT hr = S_OK;
    IWDFIoRequest *pWdfRequest = NULL;
    IWDFDriver * FxDriver = NULL;
    IWDFMemory * FxMemory = NULL; 
    IWDFRequestCompletionParams * FxComplParams = NULL;
    IWDFUsbRequestCompletionParams * FxUsbComplParams = NULL;

    *LengthTransferred = 0;
    
    hr = m_FxDevice->CreateRequest( NULL, //pCallbackInterface
                                    NULL, //pParentObject
    // Log Policy.
    //
    PxeTrace(g_hFilterProvider,
             PXE_TRACE_INFO,
             L"Filter Policy: %s",
             (g_uFilterPolicy == VAL_FILTER_POLICY_DENY) ? 
                L"Exclude" : L"Include");

Cleanup:
    return dwError;
}

DWORD
GetClientMacAddress(
    __in PVOID pPacket,
    __inout_ecount(MAX_MAC_ADDR_STRING_LEN) LPWSTR pwszMacAddress
)
/*++

Routine Description:

    Converts client Mac Address stored in Dhcp Packet to String. The string
    is padded with zeros to make it full 16 characeters.

Arguments:

    pPacket         -   Pointer to received packet.
    pwszMacAddress  -   [out] Contains mac address.
    
Return Value:
예제 #7
0
#define CLEANUP_ON_HR_FAIL( hr, CleanupLabel )      \
    if ( FAILED( hr ) )                             \
    {                                               \
        goto CleanupLabel;                          \
    }


//
// Declaration of utility functions.
//

HRESULT
MyLoadStringW(
    __in HINSTANCE hInstance,
    __in UINT uID,
    __inout_ecount( cchBuffer ) PWSTR wszMsg,
    __in ULONG cchBuffer );


//
// Main application entry point.
//

int __cdecl
wmain(
    int argc,
    __in_ecount(argc) wchar_t *argv[ ],
    __in wchar_t *envp[ ] )
{
    HRESULT hr = S_OK,
            hrCleanup = S_OK;