コード例 #1
0
    naming provider

Feedback:
    If you have any questions or feedback, please contact us using
    any of the mechanisms below:

    Email: [email protected]
    Newsgroup: Microsoft.public.win32.programmer.networks
    Website: http://www.microsoft.com/p2p

--********************************************************************/
#include "install.h"

// Utility routine to calculate the number of characters in an array of strings
//
ULONG GetTotalCch(ULONG cStrings, __in_ecount(cStrings) PCWSTR *prgStrings)
{
    ULONG cch = 0;
    ULONG i = 0;

    for (i = 0; i < cStrings; i++)
    {
        cch += (ULONG) wcslen(prgStrings[i]);
    }
    return cch;
}

// Installation of a naming provider requires a "blob" of a specific format to be created.
// This function will create this blob.  This function should be reusable by all naming providers.
//
// Layout:  [All offsets are from beginning of buffer]
コード例 #2
0
ファイル: efx_rx.c プロジェクト: Di0gen/test_jenkins_project
	__in		efx_nic_t *enp,
	__in		unsigned int buf_size);
#endif /* EFSYS_OPT_RX_SCATTER */

#if EFSYS_OPT_RX_SCALE
static	__checkReturn	efx_rc_t
siena_rx_scale_mode_set(
	__in		efx_nic_t *enp,
	__in		efx_rx_hash_alg_t alg,
	__in		efx_rx_hash_type_t type,
	__in		boolean_t insert);

static	__checkReturn	efx_rc_t
siena_rx_scale_key_set(
	__in		efx_nic_t *enp,
	__in_ecount(n)	uint8_t *key,
	__in		size_t n);

static	__checkReturn	efx_rc_t
siena_rx_scale_tbl_set(
	__in		efx_nic_t *enp,
	__in_ecount(n)	unsigned int *table,
	__in		size_t n);

static	__checkReturn	uint32_t
siena_rx_prefix_hash(
	__in		efx_nic_t *enp,
	__in		efx_rx_hash_alg_t func,
	__in		uint8_t *buffer);

#endif /* EFSYS_OPT_RX_SCALE */
コード例 #3
0
ファイル: WSASocket.cpp プロジェクト: ssoor/http_encode
    bIsCall = HookControl::OnBeforeSockConnect(s, name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS, &tpiCallParameters, Call_IATWSAConnect);

    if (bIsCall)
        return tpiCallParameters.pfnWSAConnect(s, name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS);

    bIsCall = bIsCall && HookControl::OnAfterSockConnect(s, name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS, &tpiCallParameters, Call_IATWSAConnect);

    return tpiCallParameters.nRetValue;
}

struct PARAMETERS_CALL_LATWSASEND {
    DWORD dwFlags;
    FUN::__pfnWSASend pfnWSASend;
};

bool Call_IATWSASend(__in SOCKET s, __in_ecount(dwBufferCount) LPWSABUF lpBuffers, __in DWORD dwBufferCount, __out_opt LPDWORD lpNumberOfBytesSent, __in int * pnErrorcode, __in LPWSAOVERLAPPED lpOverlapped, __in LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, void * pExdata)
{
    int nRetValue = 0;
    bool bIsSuccess = true;
    PARAMETERS_CALL_LATWSASEND * pCallParameters = (PARAMETERS_CALL_LATWSASEND *)pExdata;

    nRetValue = pCallParameters->pfnWSASend(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, pCallParameters->dwFlags, lpOverlapped, lpCompletionRoutine);

    if (SOCKET_ERROR == nRetValue)
        bIsSuccess = (WSA_IO_PENDING == *pnErrorcode);

    return bIsSuccess;
}

int WSAAPI IATWSASend(__in SOCKET s, __in_ecount(dwBufferCount) LPWSABUF lpBuffers, __in DWORD dwBufferCount, __out_opt LPDWORD lpNumberOfBytesSent, __in DWORD dwFlags, __inout_opt LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
{
コード例 #4
0
ファイル: media_content.cpp プロジェクト: vlakoff/musepack

// return 1 if we support GetTypeInfo
STDMETHODIMP CAMMediaContent::GetTypeInfoCount(__out UINT * pctinfo)
{
    return basedisp.GetTypeInfoCount(pctinfo);
}

// attempt to find our type library
STDMETHODIMP CAMMediaContent::GetTypeInfo(UINT itinfo, LCID lcid, __deref_out ITypeInfo ** pptinfo)
{
    return basedisp.GetTypeInfo(IID_IAMMediaContent, itinfo, lcid, pptinfo);
}

STDMETHODIMP CAMMediaContent::GetIDsOfNames(REFIID riid,
  __in_ecount(cNames) LPOLESTR * rgszNames, UINT cNames,
  LCID lcid, __out_ecount(cNames) DISPID * rgdispid)
{
    return basedisp.GetIDsOfNames(IID_IAMMediaContent, rgszNames, cNames, lcid, rgdispid);
}

STDMETHODIMP CAMMediaContent::Invoke(DISPID dispidMember, REFIID riid, LCID lcid,
  WORD wFlags, __in DISPPARAMS * pdispparams, __out_opt VARIANT * pvarResult,
  __out_opt EXCEPINFO * pexcepinfo, __out_opt UINT * puArgErr)
{
    // this parameter is a dead leftover from an earlier interface
    if (IID_NULL != riid) {	return DISP_E_UNKNOWNINTERFACE; }

    ITypeInfo * pti;
    HRESULT hr = GetTypeInfo(0, lcid, &pti);
コード例 #5
0
ファイル: LinearScanMD.cpp プロジェクト: Rastaban/ChakraCore
        else if (type == TyFloat64)
        {
            this->xmmSymTable64[reg - RegXMM0] = sym;
        }
        else
        {
            Assert(IRType_IsSimd128(type));
            this->xmmSymTable128[reg - RegXMM0] = sym;
        }
    }

    return sym;
}

void
LinearScanMD::GenerateBailOut(IR::Instr * instr, __in_ecount(registerSaveSymsCount) StackSym ** registerSaveSyms, uint registerSaveSymsCount)
{
    Func *const func = instr->m_func;
    BailOutInfo *const bailOutInfo = instr->GetBailOutInfo();
    IR::Instr *firstInstr = instr->m_prev;
    if(bailOutInfo->branchConditionOpnd)
    {
        // Pass in the branch condition
        //     push condition
        IR::Instr *const newInstr = IR::Instr::New(Js::OpCode::PUSH, func);
        newInstr->SetSrc1(bailOutInfo->branchConditionOpnd);
        instr->InsertBefore(newInstr);
        newInstr->CopyNumber(instr);
        linearScan->SetSrcRegs(newInstr);
    }
コード例 #6
0
ファイル: number.cpp プロジェクト: Hasithaerathna/coreclr
    --------------------------------------

    - does the conversion with the best possible precision.
    - does not use any float arithmetic so it is not sensitive
    to differences in precision of floating point calculations
    across platforms.

    The internal integer representation of the float number is
    UINT64 mantissa + INT exponent. The mantissa is kept normalized
    ie with the most significant one being 63-th bit of UINT64.
===========================================================*/

//
// get 32-bit integer from at most 9 digits
//
static unsigned DigitsToInt(__in_ecount(count) wchar* p, int count)
{
    LIMITED_METHOD_CONTRACT

    _ASSERTE(1 <= count && count <= 9);
    wchar* end = p + count;
    unsigned res = *p - '0';
    for ( p = p + 1; p < end; p++) {
        res = 10 * res + *p - '0';
    }
    return res;
}

//
// helper macro to multiply two 32-bit uints
//
コード例 #7
0

HRESULT
ceFormatCertsrvStringArray(
    IN BOOL    fURL,
    __in LPCWSTR pwszServerName_p1_2,
    __in LPCWSTR pwszSanitizedName_p3_7,
    IN DWORD   iCert_p4,
    IN DWORD   iCertTarget_p4,
    __in LPCWSTR pwszDomainDN_p5,
    __in LPCWSTR pwszConfigDN_p6,
    IN DWORD   iCRL_p8,
    IN BOOL    fDeltaCRL_p9,
    IN BOOL    fDSAttrib_p10_11,
    IN DWORD   cStrings,
    __in_ecount(cStrings) LPCWSTR *apwszStringsIn,
    __out LPWSTR *apwszStringsOut)
{
    HRESULT hr = S_OK;
    LPCWSTR apwszInsertionArray[100];  // 100 'cause this is the max number of insertion numbers allowed by FormatMessage
    LPWSTR    pwszCurrent = NULL;
    BSTR      strShortMachineName = NULL;
    DWORD     i;
    WCHAR *pwszSanitizedDSName = NULL;
    WCHAR wszCertSuffix[2 * cwcFILENAMESUFFIXMAX];
    WCHAR wszCRLSuffix[cwcFILENAMESUFFIXMAX];
    WCHAR wszDeltaCRLSuffix[cwcFILENAMESUFFIXMAX];
    WCHAR const *pwszT;


    ZeroMemory(apwszStringsOut, cStrings * sizeof(apwszStringsOut[0]));
コード例 #8
0
            }
        }
        else
            break; /* we're done with all the forgotten tables */
    }

    Mem_Free(aDirectory);

    return(errCode);
}
/* ---------------------------------------------------------------------- */

/* ---------------------------------------------------------------------- */
[System::Security::SecurityCritical]
PRIVATE void FillGlyphIndexArray(
                            __in_ecount(usGlyphListCount) CONST uint8 *puchKeepGlyphList, 
                            CONST uint16 usGlyphListCount,
                            __out_ecount(usDttfGlyphIndexCount) uint16 *pusGlyphIndexArray,
                            uint16 usDttfGlyphIndexCount)
{
uint16 i;
uint16 usGlyphIndex = 0;

    for (i = 0; i < usGlyphListCount && usGlyphIndex < usDttfGlyphIndexCount; ++i)
    {
        if (puchKeepGlyphList[i])
        {
            pusGlyphIndexArray[usGlyphIndex] = i;
            ++usGlyphIndex;
        }
    }
コード例 #9
0
ファイル: efx_tx.c プロジェクト: Digital-Chaos/freebsd
	__in		efsys_mem_t *esmp,
	__in		size_t n,
	__in		uint32_t id,
	__in		uint16_t flags,
	__in		efx_evq_t *eep,
	__in		efx_txq_t *etp,
	__out		unsigned int *addedp);

static		void
falconsiena_tx_qdestroy(
	__in	efx_txq_t *etp);

static	__checkReturn	efx_rc_t
falconsiena_tx_qpost(
	__in		efx_txq_t *etp,
	__in_ecount(n)	efx_buffer_t *eb,
	__in		unsigned int n,
	__in		unsigned int completed,
	__inout		unsigned int *addedp);

static			void
falconsiena_tx_qpush(
	__in	efx_txq_t *etp,
	__in	unsigned int added,
	__in	unsigned int pushed);

static	__checkReturn	efx_rc_t
falconsiena_tx_qpace(
	__in		efx_txq_t *etp,
	__in		unsigned int ns);
コード例 #10
0
    return 0;
}
MOZCE_SHUNT_API
BOOL
WINAPI
GetSystemTimeAdjustment(
    __out PDWORD lpTimeAdjustment,
    __out PDWORD lpTimeIncrement,
    __out PBOOL  lpTimeAdjustmentDisabled
    )
{
    *lpTimeAdjustmentDisabled = TRUE;
    return TRUE;
}

MOZCE_SHUNT_API BOOL  WINAPI PolyBezierTo(__in HDC hdc, __in_ecount(cpt) CONST POINT * apt, __in DWORD cpt){
 MOZCE_NOT_IMPLEMENTED(__FUNCTION__); }

MOZCE_SHUNT_API BOOL WINAPI CloseFigure(__in HDC hdc){
 MOZCE_NOT_IMPLEMENTED(__FUNCTION__);
}

MOZCE_SHUNT_API BOOL WINAPI SelectClipPath(__in HDC hdc, __in int mode){
 MOZCE_NOT_IMPLEMENTED(__FUNCTION__);
}

MOZCE_SHUNT_API BOOL WINAPI EndPath(__in HDC hdc){
 MOZCE_NOT_IMPLEMENTED(__FUNCTION__);
}

MOZCE_SHUNT_API BOOL WINAPI BeginPath(__in HDC hdc){
コード例 #11
0
	if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length)) != 0)
		goto fail1;

	return (0);

fail1:
	EFSYS_PROBE1(fail1, efx_rc_t, rc);

	return (rc);
}

static	__checkReturn	efx_rc_t
ef10_filter_insert_unicast(
	__in				efx_nic_t *enp,
	__in_ecount(6)			uint8_t const *addr,
	__in				efx_filter_flags_t filter_flags)
{
	ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table;
	efx_filter_spec_t spec;
	efx_rc_t rc;

	/* Insert the filter for the local station address */
	efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
	    filter_flags,
	    eftp->eft_default_rxq);
	efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr);

	rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
	    &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]);
	if (rc != 0)
コード例 #12
0
ファイル: context.c プロジェクト: jpassing/ntrace
	}
	else
	{
		return JPFSV_E_NO_TRACESESSION;
	}
	
	LeaveCriticalSection( &Context->ProtectedMembers.Lock );

	return Hr;
}

HRESULT JpfsvSetTracePointsContext(
	__in JPFSV_HANDLE ContextHandle,
	__in JPFSV_TRACE_ACTION Action,
	__in UINT ProcedureCountRaw,
	__in_ecount(InstrCount) CONST DWORD_PTR *ProceduresRaw,
	__out_opt DWORD_PTR *FailedProcedure
	)
{
	PJPFSV_CONTEXT Context = ( PJPFSV_CONTEXT ) ContextHandle;
	PJPFSV_TRACE_SESSION TraceSession;
	HRESULT Hr;
	UINT ProcedureCountClean = 0;
	DWORD_PTR *ProceduresClean;
	UINT Index;

	if ( ! Context ||
		 Context->Signature != JPFSV_CONTEXT_SIGNATURE ||
		 ( Action != JpfsvAddTracepoint &&
		   Action != JpfsvRemoveTracepoint ) ||
		 ProcedureCountRaw == 0 ||
コード例 #13
0
			if ((configParams->pDeviceUUID != GUID_NULL || configParams->pSearchSSID != 0)
				&& configParams->pDevicePin != 0)
			{
				bReturnValue = TRUE;
			}
			break;

		default:
			break;
	}

	return bReturnValue; 
}


HRESULT parseCommandLineArguments(__out CONFIGURATION_PARAMETERS* configParameters, __in DWORD argc, __in_ecount(argc) WCHAR **pArg)
{
	HRESULT hr = ERROR_SUCCESS;

	
	
	//parse the command line inputs
	for(DWORD i = 1;i < argc;i++)
	{
		wchar_t* pCommand = 0;
		wchar_t* pContext = 0;

		pCommand = wcstok_s(
							pArg[i],
							L"=",
							&pContext);
コード例 #14
0
            TotalRead += packetSize;
            PBYTE pData = (PBYTE)( pHdr + 1 );
            for ( ULONG i = 0; i < packetSize; pData++, i++, b++ )
            {
                _ASSERT( *pData == b );
            }
            _ASSERT( msgSize == pHdr->length );
        } while( 0 == ( pHdr->flags & CHANNEL_FLAG_LAST ));

        _ASSERT( TotalRead == msgSize );
    }

    return 0;
}

INT _cdecl wmain( INT argc, __in_ecount( argc ) WCHAR **argv )
{
    DWORD rc;
    HANDLE            hFile;

    printf("Opening a Dynamic Channel DVCSmpl \n" );
    rc = OpenDynamicChannel ( "DVCSmpl", &hFile );
    if ( ERROR_SUCCESS != rc )
    {
        printf("Dynamic Channel Creation Failed\n" );
        return 0;
    }

    if ( ERROR_SUCCESS == rc )
    {
        printf("Dynamic Channel Created\n" );
コード例 #15
0
ファイル: Platform.cpp プロジェクト: DivyaMahadevan/security
}


//*** _cpri__CompleteHash()
// Complete a hash or HMAC computation. This function will place the smaller of
// 'digestSize' or the size of the digest in 'dOut'. The number of bytes in the
// placed in the buffer is returned. If there is a failure, the returned value
// is <= 0.
//  return type: UINT16
//       0      no data returned
//      > 0     the number of bytes in the digest
UINT16
_cpri__CompleteHash(
    CPRI_HASH_STATE *hashState,      // IN: the state of hash stack
    UINT32 dOutSize,                 // IN: size of digest buffer
    __in_ecount(dOutSize) BYTE *dOut // OUT: hash digest
    )
{
    OSSL_HASH_STATE *state = (OSSL_HASH_STATE *)&hashState->state;
    UINT16           retVal = 0;
    UINT32           hLen;
    UINT32           cbResult;
    BYTE             digest[64];

    if((BCryptGetProperty(state->hHash, BCRYPT_HASH_LENGTH, (PUCHAR)&hLen, sizeof(hLen), (ULONG*)&cbResult, 0) != 0) ||
       (sizeof(digest) < hLen))
    {
        goto Cleanup;
    }

    if(BCryptFinishHash(state->hHash, digest, hLen, 0) != 0)
コード例 #16
0
ファイル: client.cpp プロジェクト: kcrazy/winekit
    argc - argument count
    argv - pointer to an array of command line arguments

Return Value:

    S_OK         - The operation succeeded.
    E_FAIL       - The operation failed.
    E_INVALIDARG - Invalid flag/option specified.

--*/
EXTERN_C
HRESULT _cdecl
_tmain(
    __in              INT         argc,
    __in_ecount(argc) TCHAR**     argv
    )
{
    HRESULT hrResult = E_FAIL;
    CmdLineArgs Args = {0};

    hrResult = ParseCommandLine(argc, argv, &Args);

    if (SUCCEEDED(hrResult))
    {
        hrResult = ValidateArgs(&Args);
    }

    if (SUCCEEDED(hrResult))
    {
        hrResult = ExecuteSample(&Args);
コード例 #17
0
fail2:
	EFSYS_PROBE(fail2);
fail1:
	EFSYS_PROBE1(fail1, int, rc);

	EFX_RX_LFSR_HASH(enp, B_FALSE);

	return (rc);
}
#endif

#if EFSYS_OPT_RX_SCALE
	__checkReturn	int
efx_rx_scale_toeplitz_ipv4_key_set(
	__in		efx_nic_t *enp,
	__in_ecount(n)	uint8_t *key,
	__in		size_t n)
{
	efx_oword_t oword;
	unsigned int byte;
	unsigned int offset;
	int rc;

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);

	byte = 0;

	/* Write toeplitz hash key */
	EFX_ZERO_OWORD(oword);
	for (offset = (FRF_BZ_RX_RSS_TKEY_LBN + FRF_BZ_RX_RSS_TKEY_WIDTH) / 8;
コード例 #18
0
ファイル: PwUtil.cpp プロジェクト: coderb/KeePass-1.x
	if(nErrorCode == PWE_NOFILEACCESS_READ_KEY)
	{
		str += _T("\r\n\r\n");
		str += TRL("Make sure the media that contains the key file is inserted and that KeePass has the rights to access it (check file access rights, ensure that no other application is blocking the file, ...).");
	}

	if((dwFlags & PWFF_DATALOSS_WITHOUT_SAVE) != 0)
	{
		str += _T("\r\n\r\n");
		str += TRL("The target file might be in a corrupted state. Please try saving again, and if that fails, save the database to a different location.");
	}

	return str;
}

BOOL CPwUtil::MemAllocCopyEntry(__in_ecount(1) const PW_ENTRY *pExisting,
	__out_ecount(1) PW_ENTRY *pDestination)
{
	ASSERT_ENTRY(pExisting); ASSERT(pDestination != NULL);
	if((pExisting == NULL) || (pDestination == NULL)) return FALSE;

	ZeroMemory(pDestination, sizeof(PW_ENTRY));

	pDestination->uBinaryDataLen = pExisting->uBinaryDataLen;
	if(pExisting->pBinaryData != NULL)
	{
		pDestination->pBinaryData = new BYTE[pExisting->uBinaryDataLen + 1];
		ASSERT(pDestination->pBinaryData != NULL); if(pDestination->pBinaryData == NULL) return FALSE;
		pDestination->pBinaryData[pExisting->uBinaryDataLen] = 0;
		memcpy(pDestination->pBinaryData, pExisting->pBinaryData, pExisting->uBinaryDataLen);
	}
コード例 #19
0
ファイル: eseutil.cpp プロジェクト: BMurri/wix3
            (*ppjccColumnCreate)[i].grbit |= JET_bitColumnNotNULL;
        }

        (*ppjccColumnCreate)[i].pvDefault = NULL;
        (*ppjccColumnCreate)[i].cbDefault = 0;
        (*ppjccColumnCreate)[i].cp = 1200;
        (*ppjccColumnCreate)[i].columnid = 0;
        (*ppjccColumnCreate)[i].err = 0;
    }

LExit:
    return hr;
}

HRESULT FreeColumnCreateStruct(
    __in_ecount(dwColumns) JET_COLUMNCREATE *pjccColumnCreate,
    __in DWORD dwColumns
    )
{
    HRESULT hr = S_OK;
    DWORD i;

    for (i = 0; i < dwColumns; ++i)
    {
        ReleaseStr((pjccColumnCreate[i]).szColumnName);
    }

    hr = MemFree(pjccColumnCreate);
    ExitOnFailure(hr, "Failed to release core column create struct");

LExit:
コード例 #20
0
	ZeroMemory( &desc, sizeof(desc) );
	desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE;
	desc.ByteWidth = uElementSize * uCount;
	desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
	desc.StructureByteStride = uElementSize;

	if ( pInitData )
	{
		D3D11_SUBRESOURCE_DATA InitData;
		InitData.pSysMem = pInitData;
		return pDevice->CreateBuffer( &desc, &InitData, ppBufOut );
	} else
		return pDevice->CreateBuffer( &desc, NULL, ppBufOut );
}

HRESULT FindDXSDKShaderFileCch( __in_ecount(cchDest) WCHAR* strDestPath,
                                int cchDest, 
                                __in LPCWSTR strFilename )
{
	
    if( NULL == strFilename || strFilename[0] == 0 || NULL == strDestPath || cchDest < 10 )
        return E_INVALIDARG;

    // Get the exe name, and exe path
    WCHAR strExePath[MAX_PATH] =
    {
        0
    };
    WCHAR strExeName[MAX_PATH] =
    {
        0
コード例 #21
0
ファイル: ndasntfs.c プロジェクト: Nevermore2015/ndas4windows
    __in PLIST_ENTRY NotifyList,
    __in PVOID FsContext,
    __in PSTRING FullDirectoryName,
    __in BOOLEAN WatchTree,
    __in BOOLEAN IgnoreBuffer,
    __in ULONG CompletionFilter,
    __in_opt PIRP NotifyIrp,
    __in_opt PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback,
    __in_opt PSECURITY_SUBJECT_CONTEXT SubjectContext,
    __in_opt PFILTER_REPORT_CHANGE FilterCallback
    );

NTSTATUS
(*NdasNtfsMmPrefetchPages) (
    __in ULONG NumberOfLists,
    __in_ecount (NumberOfLists) PREAD_LIST *ReadLists
    );

VOID
(*NdasNtfsFsRtlIncrementCcFastReadWait) (
    VOID
    );

VOID
(*NdasNtfsFsRtlIncrementCcFastReadNoWait) (
    VOID
    );

VOID
(*NdasNtfsFsRtlIncrementCcFastReadResourceMiss) (
    VOID
コード例 #22
0
ファイル: fxusbdeviceum.cpp プロジェクト: AntejaVM/WDF
    status = m_InterfaceIterationLock.Initialize();
    if (!NT_SUCCESS(status)) {
        goto Done;
    }

Done:
    return status;
}




_Must_inspect_result_
NTSTATUS
FxUsbDevice::GetString(
    __in_ecount(*NumCharacters) PUSHORT String,
    __in PUSHORT NumCharacters,
    __in UCHAR StringIndex,
    __in_opt USHORT LangID,
    __in_opt WDFREQUEST Request,
    __in_opt PWDF_REQUEST_SEND_OPTIONS Options
    )
{
    UMURB urb;
    PUSB_STRING_DESCRIPTOR pDescriptor;
    PVOID buffer = NULL;
    USB_COMMON_DESCRIPTOR common;
    ULONG length;
    NTSTATUS status;

    if (String != NULL) {
コード例 #23
0
ファイル: sioctl.c プロジェクト: huyna/GHAST
__drv_dispatchType(IRP_MJ_CREATE)
__drv_dispatchType(IRP_MJ_CLOSE)
DRIVER_DISPATCH SioctlCreateClose;

__drv_dispatchType(IRP_MJ_DEVICE_CONTROL)
DRIVER_DISPATCH SioctlDeviceControl;

DRIVER_UNLOAD SioctlUnloadDriver;

VOID
PrintIrpInfo(
    PIRP Irp
    );
VOID
PrintChars(
    __in_ecount(CountChars) PCHAR BufferAddress,
    __in size_t CountChars
    );

#ifdef ALLOC_PRAGMA
#pragma alloc_text( INIT, DriverEntry )
#pragma alloc_text( PAGE, SioctlCreateClose)
#pragma alloc_text( PAGE, SioctlDeviceControl)
#pragma alloc_text( PAGE, SioctlUnloadDriver)
#pragma alloc_text( PAGE, PrintIrpInfo)
#pragma alloc_text( PAGE, PrintChars)
#endif // ALLOC_PRAGMA


NTSTATUS
DriverEntry(
コード例 #24
0
ファイル: enum.c プロジェクト: kcrazy/winekit
#if !defined(__isascii)
#define __isascii(_c)   ( (unsigned)(_c) < 0x80 )
#endif // !defined(__isascii)

// disable warnings

#if _MSC_VER >= 1200
#pragma warning(push)
#endif

#pragma warning(disable:4127) // conditional expression is constant

void
SerenumScanOtherIdForMouse( 
    __in_ecount(BufLen)                  PCHAR PBuffer, 
    __in ULONG                           BufLen,
    __deref_out_ecount_opt(*PmouseIdLen) PCHAR *PpMouseId,
    __out                                ULONG *PmouseIdLen                                            
    )
/*++

Routine Description:

    This routines a PnP packet for a mouse ID up to the first PnP delimiter
    (i.e, '(').

Arguments:

   PBuffer - Pointer to the buffer to scan
コード例 #25
0
ファイル: wxdebug.cpp プロジェクト: XhmikosR/mpc-hc
    DbgLog((LOG_MEMORY,1,szInfo));
    LeaveCriticalSection(&m_CSDebug);
}

/*  Debug infinite wait stuff */
DWORD WINAPI DbgWaitForSingleObject(HANDLE h)
{
    DWORD dwWaitResult;
    do {
        dwWaitResult = WaitForSingleObject(h, dwWaitTimeout);
        ASSERT(dwWaitResult == WAIT_OBJECT_0);
    } while (dwWaitResult == WAIT_TIMEOUT);
    return dwWaitResult;
}
DWORD WINAPI DbgWaitForMultipleObjects(DWORD nCount,
                                __in_ecount(nCount) CONST HANDLE *lpHandles,
                                BOOL bWaitAll)
{
    DWORD dwWaitResult;
    do {
        dwWaitResult = WaitForMultipleObjects(nCount,
                                              lpHandles,
                                              bWaitAll,
                                              dwWaitTimeout);
        ASSERT((DWORD)(dwWaitResult - WAIT_OBJECT_0) < MAXIMUM_WAIT_OBJECTS);
    } while (dwWaitResult == WAIT_TIMEOUT);
    return dwWaitResult;
}

void WINAPI DbgSetWaitTimeout(DWORD dwTimeout)
{
コード例 #26
0
ファイル: efx_mac.c プロジェクト: Eastsideboy/freebsd
     * Decode the requested flow control settings from the PHY
     * advertised capabilities.
     */
    if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_PAUSE))
        wanted = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
    if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_ASYM))
        wanted ^= EFX_FCNTL_GENERATE;

    *fcntl_linkp = epp->ep_fcntl;
    *fcntl_wantedp = wanted;
}

__checkReturn	efx_rc_t
efx_mac_multicast_list_set(
    __in				efx_nic_t *enp,
    __in_ecount(6*count)		uint8_t const *addrs,
    __in				int count)
{
    efx_port_t *epp = &(enp->en_port);
    efx_mac_ops_t *emop = epp->ep_emop;
    uint8_t	*old_mulcst_addr_list = NULL;
    uint32_t old_mulcst_addr_count;
    efx_rc_t rc;

    EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
    EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);

    if (count > EFX_MAC_MULTICAST_LIST_MAX) {
        rc = EINVAL;
        goto fail1;
    }
コード例 #27
0
ファイル: outputq.cpp プロジェクト: medyakovvit/litiv
}

//
//  COutputQueue::ReceiveMultiple()
//
//  Send a set of samples to the downstream pin
//
//      ppSamples           - array of samples
//      nSamples            - how many
//      nSamplesProcessed   - How many were processed
//
//  On return all samples will have been Release()'d
//

HRESULT COutputQueue::ReceiveMultiple (
    __in_ecount(nSamples) IMediaSample **ppSamples,
    long nSamples,
    __out long *nSamplesProcessed)
{
    if (nSamples < 0) {
        return E_INVALIDARG;
    }
    
    CAutoLock lck(this);
    //  Either call directly or queue up the samples

    if (!IsQueued()) {

        //  If we already had a bad return code then just return

        if (S_OK != m_hr) {
コード例 #28
0
ファイル: w_str.c プロジェクト: mysticTot/learn_c
*       int      lcid        - for A call, specify LCID, If 0, use
*                              __lc_handle[LC_CTYPE].
*
*Exit:
*       Success: TRUE
*       Failure: FALSE
*
*Exceptions:
*
*******************************************************************************/

static BOOL __cdecl __crtGetStringTypeW_stat
(
    __in_opt _locale_t plocinfo,
    __in DWORD dwInfoType,
    __in_ecount(_CchSrc) LPCWSTR lpSrcStr,
    __in int cchSrc,
    __out LPWORD lpCharType,
    __in int code_page,
    __in int lcid
) {
    static int f_use = 0;

    /*
     * Look for unstubbed 'preferred' flavor. Otherwise use available flavor.
     * Must actually call the function to ensure it's not a stub.
     */

    if (cchSrc < -1) {
        return FALSE;
    }
コード例 #29
0
ファイル: Reg.c プロジェクト: Essjay1/Windows-classic-samples
    if (*pwzDest == NULL)
    {
        err = WSA_NOT_ENOUGH_MEMORY;
    }
    else
    {
        memcpy(*pwzDest, wzSrc, cb);
    }

    return err;
}


// Utility routine to allocate memory and copy an array of CSADDR_INFO
//
INT CopyAddrs(__in_ecount(cAddrs) CSADDR_INFO *rgAddrsSrc, 
                                  DWORD cAddrs,
                      __deref_out CSADDR_INFO **prgAddrsDest)
{
    INT err = NO_ERROR;
    ULONG i = 0;

    CSADDR_INFO *rgAddrsDest = (CSADDR_INFO *)malloc(cAddrs * sizeof(CSADDR_INFO));

    if (rgAddrsDest == NULL)
    {
        return WSA_NOT_ENOUGH_MEMORY;
    }

    ZeroMemory(rgAddrsDest, cAddrs * sizeof(CSADDR_INFO));
コード例 #30
0
ファイル: StringUtils.cpp プロジェクト: kcrazy/winekit
        if(FAILED(hResult))
        {
            HeapFree(hHeap, 0, pszCopy);
            pszCopy = NULL;
            SetLastError(hResult);
        }
    }

    return pszCopy;
}

// Frees list of strings.
// NOTE: don't use this for string list made with MakeStrPtrList(), since
//       the strings pointed to be list made with MakeStrPtrList() will
//       be freed when the multi-sz is freed.
void FreeStringList(HANDLE hHeap, __in_ecount(wCount) PWSTR *ppszList, WORD wCount)
{
    // Validate parameters.
    if( (NULL == hHeap)
        ||
        (NULL == ppszList)
      )
    {
        return;
    }

    // Free each of the strings in the list.
    for(WORD wIndex = 0; wIndex < wCount; ++wIndex)
    {
        if(NULL != ppszList[wIndex]) HeapFree(hHeap, 0, ppszList[wIndex]);
    }