本文整理汇总了C++中UNREFERENCED_PARAMETER函数的典型用法代码示例。如果您正苦于以下问题:C++ UNREFERENCED_PARAMETER函数的具体用法?C++ UNREFERENCED_PARAMETER怎么用?C++ UNREFERENCED_PARAMETER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UNREFERENCED_PARAMETER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IEEnumChildProc
//-----------------------------------------------------------------------------
// IEEnumChildProc()
//-----------------------------------------------------------------------------
// Enumération des fils de la fenêtre navigateur à la recherche
// de la barre d'adresse pour vérifier l'URL -> changé en 0.83, voir dans swSSOWeb.cpp
//-----------------------------------------------------------------------------
// [in] lp = &psz
//-----------------------------------------------------------------------------
static int CALLBACK IEEnumChildProc(HWND w, LPARAM lp)
{
UNREFERENCED_PARAMETER(lp);
int rc=true; // true=continuer l'énumération
char szClassName[128+1];
DWORD dw;
HRESULT hr;
IHTMLDocument2 *pHTMLDocument2=NULL;
BSTR bstrURL=NULL;
BSTR bstrState=NULL;
T_GETURL *ptGetURL=(T_GETURL *)lp;
// 0.85B6 : je supprime la comparaison du titre car ne fonctionne pas quand le titre est trop long !
// (exemple copaindavant -> titre fenêtre windows tronqué vs titre html entier, incomparable donc)
GetClassName(w,szClassName,sizeof(szClassName));
TRACE((TRACE_DEBUG,_F_,"w=0x%08lx class=%s",w,szClassName));
if (strcmp(szClassName,"Internet Explorer_Server")!=0) goto end;
// récupération pointeur sur le document HTML (interface IHTMLDocument2)
SendMessageTimeout(w,guiHTMLGetObjectMsg,0L,0L,SMTO_ABORTIFHUNG,1000,&dw);
hr=(*gpfObjectFromLresult)(dw,IID_IHTMLDocument2,0,(void**)&pHTMLDocument2);
if (FAILED(hr))
{
TRACE((TRACE_ERROR,_F_,"gpfObjectFromLresult(%d,IID_IHTMLDocument2)=0x%08lx",dw,hr));
goto end;
}
TRACE((TRACE_DEBUG,_F_,"gpfObjectFromLresult(IID_IHTMLDocument2)=%08lx pHTMLDocument2=%08lx",hr,pHTMLDocument2));
// 0.90 : ne commence pas tant que le document n'est pas chargé
// (uniquement dans le cas d'une simulation de frappe clavier ?)
// 0.97 : on ne le fait que si bWaitReady (et notamment on ne le fait pas dans le cas des popups cf. ISSUE#87)
if (ptGetURL->bWaitReady)
{
hr=pHTMLDocument2->get_readyState(&bstrState);
if (FAILED(hr))
{
TRACE((TRACE_ERROR,_F_,"get_readyState=0x%08lx",hr));
// ca n'a pas marché, pas grave, on continue quand même
}
else
{
TRACE((TRACE_INFO,_F_,"readyState=%S",bstrState));
if (!CompareBSTRtoSZ(bstrState,"complete")) { rc=false; goto end; } // pas fini de charger, on arrête
}
}
hr=pHTMLDocument2->get_URL(&bstrURL);
if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"get_URL()=0x%08lx",hr)); goto end; }
TRACE((TRACE_DEBUG,_F_,"get_URL()=%S",bstrURL));
ptGetURL->pszURL=(char*)malloc(SysStringLen(bstrURL)+1);
if (ptGetURL->pszURL==NULL) { TRACE((TRACE_ERROR,_F_,"malloc(%d)=NULL",SysStringLen(bstrURL)+1)); goto end; }
wsprintf(ptGetURL->pszURL,"%S",bstrURL);
rc=false; // trouvé l'URL, on arrete l'enum
end:
if (bstrState!=NULL) SysFreeString(bstrState);
if (pHTMLDocument2!=NULL) pHTMLDocument2->Release();
if (bstrURL!=NULL) SysFreeString(bstrURL);
return rc;
}
示例2: DriverEntry
NTSTATUS
DriverEntry (
PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath
)
/*++
Routine Description:
DriverEntry initializes the driver and is the first routine called by the
system after the driver is loaded. DriverEntry configures and creates a WDF
driver object.
Parameters Description:
DriverObject - Supplies a pointer to the driver object.
RegistryPath - Supplies a pointer to a unicode string representing the path
to the driver-specific key in the registry.
Return Value:
NTSTATUS.
--*/
{
WDF_OBJECT_ATTRIBUTES DriverAttributes;
WDF_DRIVER_CONFIG DriverConfig;
NTSTATUS Status;
UNREFERENCED_PARAMETER(RegistryPath);
DebugEnter();
WDF_DRIVER_CONFIG_INIT(&DriverConfig, SimSensorDriverDeviceAdd);
//
// Initialize attributes and a context area for the driver object.
//
WDF_OBJECT_ATTRIBUTES_INIT(&DriverAttributes);
DriverAttributes.SynchronizationScope = WdfSynchronizationScopeNone;
//
// Create the driver object
//
Status = WdfDriverCreate(DriverObject,
RegistryPath,
&DriverAttributes,
&DriverConfig,
WDF_NO_HANDLE);
if (!NT_SUCCESS(Status)) {
DebugPrint(SIMSENSOR_ERROR,
"WdfDriverCreate() Failed. Status 0x%x\n",
Status);
goto DriverEntryEnd;
}
DriverEntryEnd:
DebugExitStatus(Status);
return Status;
}
示例3: SimSensorIoDeviceControl
VOID
SimSensorIoDeviceControl(
WDFQUEUE Queue,
WDFREQUEST Request,
size_t OutputBufferLength,
size_t InputBufferLength,
ULONG IoControlCode
)
/*++
Routine Description:
Handles requests to read or write the simulated device state.
Arguments:
Queue - Supplies a handle to the framework queue object that is associated
with the I/O request.
Request - Supplies a handle to a framework request object. This one
represents the IRP_MJ_DEVICE_CONTROL IRP received by the framework.
OutputBufferLength - Supplies the length, in bytes, of the request's output
buffer, if an output buffer is available.
InputBufferLength - Supplies the length, in bytes, of the request's input
buffer, if an input buffer is available.
IoControlCode - Supplies the Driver-defined or system-defined I/O control
code (IOCtl) that is associated with the request.
Return Value:
VOID
--*/
{
ULONG BytesReturned;
WDFDEVICE Device;
BOOLEAN Result;
WDF_REQUEST_SEND_OPTIONS RequestSendOptions;
NTSTATUS Status;
UNREFERENCED_PARAMETER(InputBufferLength);
UNREFERENCED_PARAMETER(OutputBufferLength);
PAGED_CODE();
Device = WdfIoQueueGetDevice(Queue);
DebugPrint(SIMSENSOR_NOTE, "SimSensorIoDeviceControl: 0x%p\n", Device);
BytesReturned = 0;
switch(IoControlCode) {
case IOCTL_THERMAL_READ_TEMPERATURE:
//
// This call will either complete the request or put it in the pending
// queue.
//
SimSensorAddReadRequest(Device, Request);
break;
default:
//
// Unrecognized IOCtls must be forwarded down the stack.
//
WDF_REQUEST_SEND_OPTIONS_INIT(
&RequestSendOptions,
WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET);
WdfRequestFormatRequestUsingCurrentType(Request);
Result = WdfRequestSend(
Request,
WdfDeviceGetIoTarget(Device),
&RequestSendOptions);
if (Result == FALSE) {
Status = WdfRequestGetStatus(Request);
DebugPrint(SIMSENSOR_WARN,
"WdfRequestSend() Failed. Request Status = 0x%x\n",
Status);
WdfRequestComplete(Request, Status);
}
break;
}
}
示例4: DllMain
//-------------------------------------------------
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD reason, LPVOID reserved)
{
HANDLE hMapObject = NULL; /* handle to file mapping */
BOOL fInit, fIgnore;
// ThreadData *pThread;
switch (reason) {
case DLL_PROCESS_ATTACH:
/* Create a named file mapping object */
MyInstance = hModule;
hMapObject = CreateFileMapping(
(HANDLE) 0xFFFFFFFF, /* use paging file */
NULL, /* no security attr. */
PAGE_READWRITE, /* read/write access */
0, /* size: high 32-bits */
sizeof(SharedMem), /* size: low 32-bits */
_TEXT("UniKeyHookSharedMem3.65 Release"));/* name of map object */
if (hMapObject == NULL)
return FALSE;
fInit = (GetLastError() != ERROR_ALREADY_EXISTS);
/* Get a pointer to the file-mapped shared memory. */
pShMem = (SharedMem *) MapViewOfFile(
hMapObject, /* object to map view of */
FILE_MAP_WRITE, /* read/write access */
0, /* high offset: map from */
0, /* low offset: beginning */
0); /* default: map entire file */
if (pShMem == NULL)
return FALSE;
InitProcess();
if (fInit)
initDLL();
// TlsIdx = TlsAlloc();
// InitThread();
break;
/*
* The DLL is detaching from a process due to
* process termination or a call to FreeLibrary.
*/
/*
case DLL_THREAD_ATTACH:
InitThread();
break;
case DLL_THREAD_DETACH:
pThread = (ThreadData *)TlsGetValue(TlsIdx);
if (pThread != NULL)
delete pThread;
break;
*/
case DLL_PROCESS_DETACH:
/* Unmap shared memory from the process's address space. */
fIgnore = UnmapViewOfFile(pShMem);
/* Close the process's handle to the file-mapping object. */
fIgnore = CloseHandle(hMapObject);
// TlsFree(TlsIdx);
break;
default:
break;
}
return TRUE;
UNREFERENCED_PARAMETER(hModule);
UNREFERENCED_PARAMETER(reserved);
}
示例5: UNREFERENCED_PARAMETER
HRESULT __stdcall IOemPS::WritePrinter(
PDEVOBJ pdevobj,
PVOID pBuf,
DWORD cbBuffer,
PDWORD pcbWritten)
{
if( cbBuffer == 0){
*pcbWritten = 0;
return S_OK;
}
if( ! isTSPrinter(pdevobj->hPrinter)){
UNREFERENCED_PARAMETER(pdevobj);
UNREFERENCED_PARAMETER(pBuf);
UNREFERENCED_PARAMETER(cbBuffer);
UNREFERENCED_PARAMETER(pcbWritten);
return E_NOTIMPL;
}
//get spool tempfile
POEMPDEV poempdev;
poempdev = (POEMPDEV)pdevobj->pdevOEM;
if (poempdev->spoolPSFileName == NULL) {
wchar_t* spoolFileName = NULL;
spoolFileName = GetNewSpoolJobName();
if (spoolFileName == NULL) {
return E_NOTIMPL;
}
else {
poempdev->spoolPSFileName = new wchar_t[256];
poempdev->spoolPDFFileName = new wchar_t[256];
swprintf_s(poempdev->spoolPDFFileName, MAX_PATH, L"%s.pdf", spoolFileName);
swprintf_s(poempdev->spoolPSFileName, MAX_PATH, L"%s.ps", spoolFileName);
}
}
HANDLE hHandle = CreateFile(poempdev->spoolPSFileName, FILE_APPEND_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hHandle == INVALID_HANDLE_VALUE){
hHandle = CreateFile(poempdev->spoolPSFileName, GENERIC_ALL, FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
}
if (hHandle == INVALID_HANDLE_VALUE){
return E_NOTIMPL;
}
WriteFile(hHandle, pBuf, cbBuffer, pcbWritten, 0);
CloseHandle(hHandle);
if(isEOF((char*)pBuf, cbBuffer)){
DoConvertion(poempdev->spoolPSFileName, poempdev->spoolPDFFileName);
SendPDF(pdevobj->hPrinter, poempdev->spoolPDFFileName);
DeleteFile(poempdev->spoolPSFileName);
DeleteFile(poempdev->spoolPDFFileName);
//free memory
if (poempdev->spoolPSFileName != NULL) {
delete poempdev->spoolPSFileName;
delete poempdev->spoolPDFFileName;
poempdev->spoolPSFileName = NULL;
poempdev->spoolPDFFileName = NULL;
}
*pcbWritten = cbBuffer;
return S_OK;
}
//UNREFERENCED_PARAMETER(pdevobj);
UNREFERENCED_PARAMETER(pBuf);
//UNREFERENCED_PARAMETER(cbBuffer);
//UNREFERENCED_PARAMETER(pcbWritten);
*pcbWritten = cbBuffer;
return S_OK;
}
示例6: assert
bool XmlProfileParser::ParseFile(const char *pszPath, Profile *pProfile, HMODULE hModule)
{
assert(pszPath != nullptr);
assert(pProfile != nullptr);
// import schema from the named resource
HRSRC hSchemaXmlResource = FindResource(hModule, L"DISKSPD.XSD", RT_HTML);
assert(hSchemaXmlResource != NULL);
HGLOBAL hSchemaXml = LoadResource(hModule, hSchemaXmlResource);
assert(hSchemaXml != NULL);
LPVOID pSchemaXml = LockResource(hSchemaXml);
assert(pSchemaXml != NULL);
// convert from utf-8 produced by the xsd authoring tool to utf-16
int cchSchemaXml = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pSchemaXml, -1, NULL, 0);
vector<WCHAR> vWideSchemaXml(cchSchemaXml);
int dwcchWritten = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pSchemaXml, -1, vWideSchemaXml.data(), cchSchemaXml);
UNREFERENCED_PARAMETER(dwcchWritten);
assert(dwcchWritten == cchSchemaXml);
// ... and finally, packed in a bstr for the loadXml interface
CComBSTR bSchemaXml(vWideSchemaXml.data());
bool fComInitialized = false;
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (SUCCEEDED(hr))
{
fComInitialized = true;
CComPtr<IXMLDOMDocument2> spXmlDoc = nullptr;
CComPtr<IXMLDOMDocument2> spXmlSchema = nullptr;
CComPtr<IXMLDOMSchemaCollection2> spXmlSchemaColl = nullptr;
CComPtr<IXMLDOMParseError> spXmlParseError = nullptr;
// create com objects and decorate
hr = CoCreateInstance(__uuidof(DOMDocument60), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&spXmlSchema));
if (SUCCEEDED(hr))
{
hr = spXmlSchema->put_async(VARIANT_FALSE);
}
if (SUCCEEDED(hr))
{
hr = spXmlSchema->setProperty(CComBSTR("ProhibitDTD"), CComVariant(VARIANT_FALSE));
}
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(__uuidof(XMLSchemaCache60), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&spXmlSchemaColl));
}
if (SUCCEEDED(hr))
{
hr = spXmlSchemaColl->put_validateOnLoad(VARIANT_TRUE);
}
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(__uuidof(DOMDocument60), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&spXmlDoc));
}
if (SUCCEEDED(hr))
{
hr = spXmlDoc->put_async(VARIANT_FALSE);
}
if (SUCCEEDED(hr))
{
hr = spXmlDoc->put_validateOnParse(VARIANT_TRUE);
}
if (SUCCEEDED(hr))
{
VARIANT_BOOL fvIsOk;
hr = spXmlSchema->loadXML(bSchemaXml, &fvIsOk);
if (FAILED(hr) || fvIsOk != VARIANT_TRUE)
{
hr = spXmlSchema->get_parseError(&spXmlParseError);
if (SUCCEEDED(hr))
{
ReportXmlError("schema", spXmlParseError);
}
hr = E_FAIL;
}
}
if (SUCCEEDED(hr))
{
CComVariant vXmlSchema(spXmlSchema);
CComBSTR bNull("");
hr = spXmlSchemaColl->add(bNull, vXmlSchema);
}
if (SUCCEEDED(hr))
{
CComVariant vSchemaCache(spXmlSchemaColl);
hr = spXmlDoc->putref_schemas(vSchemaCache);
}
if (SUCCEEDED(hr))
{
VARIANT_BOOL fvIsOk;
CComVariant vPath(pszPath);
hr = spXmlDoc->load(vPath, &fvIsOk);
if (FAILED(hr) || fvIsOk != VARIANT_TRUE)
{
hr = spXmlDoc->get_parseError(&spXmlParseError);
if (SUCCEEDED(hr))
{
ReportXmlError("profile", spXmlParseError);
}
hr = E_FAIL;
//.........这里部分代码省略.........
示例7: UNREFERENCED_PARAMETER
HRESULT CBasePin::GetMediaType(int iPosition, CMediaType *pMediaType)
{
UNREFERENCED_PARAMETER(iPosition);
UNREFERENCED_PARAMETER(pMediaType);
return E_UNEXPECTED;
}
示例8: UNREFERENCED_PARAMETER
HRESULT CMuxPhysicalAdapter::ApplyPnpChanges(
INetCfgPnpReconfigCallback *pfCallback,
ConfigAction eApplyAction)
{
CMuxVirtualMiniport *pMiniport = NULL;
GUID guidMiniport;
DWORD dwMiniportCount;
DWORD i;
HRESULT hr;
#ifdef CUSTOM_EVENTS
LPWSTR lpDevice;
WCHAR szMiniportGuid[MAX_PATH+1];
DWORD dwBytes;
INetCfgComponent *pncc;
LPWSTR lpszBindName;
PNOTIFY_CUSTOM_EVENT lppnpEvent;
#endif
UNREFERENCED_PARAMETER(eApplyAction);
TraceMsg( L"-->CMuxPhysicalAdapter::ApplyPnpChanges.\n" );
#ifdef CUSTOM_EVENTS
//
// Find the instance of the adapter to get its bindname.
//
hr = HrFindInstance( m_pnc,
m_guidAdapter,
&pncc );
if ( hr == S_OK ) {
hr = pncc->GetBindName( &lpszBindName );
if ( hr != S_OK ) {
TraceMsg( L" GetBindName failed.(HRESULT = %x). PnP changes will not "
L"be applied and the driver will not be notified.\n",
hr );
}
ReleaseObj( pncc );
}
else {
TraceMsg( L" PnP changes will not "
L"be applied and the driver will not be notified.\n",
hr );
}
#endif
dwMiniportCount = m_MiniportsToAdd.ListCount();
TraceMsg( L" Applying PnP changes to %d new miniports.\n",
dwMiniportCount );
for (i=0; i < dwMiniportCount; ++i) {
pMiniport = NULL;
m_MiniportsToAdd.Remove( &pMiniport );
pMiniport->GetMiniportGUID( &guidMiniport );
m_MiniportList.Insert( pMiniport,
guidMiniport );
//
// Do miniport specific Pnp Changes when they are added.
//
hr = pMiniport->ApplyPnpChanges( pfCallback,
eActAdd );
if( hr != S_OK) {
// you may do something
}
#ifdef CUSTOM_EVENTS
//
// Notify the driver that one or more virtual miniports have been added.
//
StringFromGUID2( guidMiniport,
szMiniportGuid,
MAX_PATH+1 );
lpDevice = AddDevicePrefix( szMiniportGuid );
if ( lpDevice ) {
dwBytes = sizeof(NOTIFY_CUSTOM_EVENT) +
((wcslen(lpDevice) + 1) * sizeof(WCHAR));
lppnpEvent = (PNOTIFY_CUSTOM_EVENT)malloc( dwBytes );
if ( lppnpEvent ) {
lppnpEvent->uSignature = NOTIFY_SIGNATURE;
lppnpEvent->uEvent = MUX_CUSTOM_EVENT;
//.........这里部分代码省略.........
示例9: MpHwFindAdapter
ULONG
MpHwFindAdapter(
__in PVOID DeviceExtension,
__in PVOID pReservedArg1,
__in PVOID pReservedArg2,
#ifdef USE_STORPORT
__in PVOID pReservedArg3,
#endif
__in PCHAR ArgumentString,
__in __out PPORT_CONFIGURATION_INFORMATION pConfigInfo,
__out PBOOLEAN pBAgain
)
{
ULONG i,
len,
status = SP_RETURN_FOUND;
PCHAR pChar;
pHW_HBA_EXT pHBAExt = (pHW_HBA_EXT)DeviceExtension;
NTSTATUS ntstatus;
#if defined(_AMD64_)
KLOCK_QUEUE_HANDLE LockHandle;
#else
KIRQL SaveIrql;
#endif
UNREFERENCED_PARAMETER(pReservedArg1);
UNREFERENCED_PARAMETER(pReservedArg2);
#ifdef USE_STORPORT
UNREFERENCED_PARAMETER(pReservedArg3);
#endif
UNREFERENCED_PARAMETER(ArgumentString);
KdPrint(("PhDskMnt::MpHwFindAdapter: Arg=%s%s%s, pHBAExt = 0x%p, pConfigInfo = 0x%p, IRQL=%i\n",
ArgumentString != NULL ? "\"" : "(",
ArgumentString != NULL ? ArgumentString : "null",
ArgumentString != NULL ? "\"" : ")",
pHBAExt,
pConfigInfo,
KeGetCurrentIrql()));
#if VERBOSE_DEBUG_TRACE > 0
if (!KD_DEBUGGER_NOT_PRESENT)
DbgBreakPoint();
#endif
if (pMPDrvInfoGlobal->GlobalsInitialized)
{
LARGE_INTEGER wait_time;
DbgPrint("PhDskMnt::MpHwFindAdapter: Already initialized.\n");
wait_time.QuadPart = -1000000;
KeDelayExecutionThread(KernelMode, FALSE, &wait_time);
}
KeInitializeSpinLock(&pHBAExt->LUListLock);
InitializeListHead(&pHBAExt->LUList);
pHBAExt->HostTargetId = (UCHAR)pMPDrvInfoGlobal->MPRegInfo.InitiatorID;
pConfigInfo->WmiDataProvider = FALSE; // Indicate WMI provider.
pConfigInfo->NumberOfPhysicalBreaks = 4096;
pConfigInfo->MaximumTransferLength = 8 << 20; // 8 MB.
#ifdef USE_STORPORT
pConfigInfo->VirtualDevice = TRUE; // Inidicate no real hardware.
pConfigInfo->SynchronizationModel = StorSynchronizeFullDuplex;
if (pConfigInfo->Dma64BitAddresses == SCSI_DMA64_SYSTEM_SUPPORTED)
pConfigInfo->Dma64BitAddresses = SCSI_DMA64_MINIPORT_FULL64BIT_SUPPORTED;
#endif
#ifdef USE_SCSIPORT
//if (pConfigInfo->NumberOfPhysicalBreaks == SP_UNINITIALIZED_VALUE)
// pConfigInfo->NumberOfPhysicalBreaks = 4096;
//if (pConfigInfo->MaximumTransferLength > (64 << 10))
// pConfigInfo->MaximumTransferLength = 64 << 10; // 64 KB.
pConfigInfo->Dma64BitAddresses = SCSI_DMA64_MINIPORT_SUPPORTED;
#endif
pConfigInfo->AlignmentMask = 0x3; // Indicate DWORD alignment.
pConfigInfo->CachesData = FALSE; // Indicate miniport wants flush and shutdown notification.
pConfigInfo->MaximumNumberOfTargets = SCSI_MAXIMUM_TARGETS; // Indicate maximum targets.
pConfigInfo->NumberOfBuses =
(UCHAR)pMPDrvInfoGlobal->MPRegInfo.NumberOfBuses; // Indicate number of busses.
pConfigInfo->ScatterGather = TRUE; // Indicate scatter-gather (explicit setting needed for Win2003 at least).
//.........这里部分代码省略.........
示例10: BthEchoRepeatReaderSubmit
NTSTATUS
BthEchoRepeatReaderSubmit(
__in PBTHECHOSAMPLE_DEVICE_CONTEXT_HEADER DevCtxHdr,
__in PBTHECHO_REPEAT_READER RepeatReader
)
/*++
Description:
This routine submits the repeat reader.
In case of failure it invoked contreader failed callback
Arguments:
DevCtxHdr - Device context header
RepeatReader - Repeat reader to submit
Return Value:
NTSTATUS Status code.
--*/
{
NTSTATUS status, statusReuse;
WDF_REQUEST_REUSE_PARAMS reuseParams;
struct _BRB_L2CA_ACL_TRANSFER *brb = &RepeatReader->TransferBrb;
DevCtxHdr->ProfileDrvInterface.BthReuseBrb((PBRB)brb, BRB_L2CA_ACL_TRANSFER);
WDF_REQUEST_REUSE_PARAMS_INIT(&reuseParams, WDF_REQUEST_REUSE_NO_FLAGS, STATUS_UNSUCCESSFUL);
statusReuse = WdfRequestReuse(RepeatReader->RequestPendingRead, &reuseParams);
ASSERT(NT_SUCCESS(statusReuse));
UNREFERENCED_PARAMETER(statusReuse);
//
// Check if we are stopping, if yes set StopEvent and exit.
//
// After this point request is eligible for cancellation, so if this
// flag gets set after we check it, request will be cancelled for stopping
// the repeat reader and next time around we will stop when we are invoked
// again upon completion of cancelled request.
//
if (RepeatReader->Stopping)
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CONT_READER,
"Continuos reader 0x%p stopping", RepeatReader);
KeSetEvent(&RepeatReader->StopEvent, 0, FALSE);
status = STATUS_SUCCESS;
goto exit;
}
//
// Format request for L2CA IN transfer
//
status = BthEchoConnectionObjectFormatRequestForL2CaTransfer(
RepeatReader->Connection,
RepeatReader->RequestPendingRead,
&brb,
RepeatReader->MemoryPendingRead,
ACL_TRANSFER_DIRECTION_IN | ACL_SHORT_TRANSFER_OK
);
if (!NT_SUCCESS(status))
{
goto exit;
}
//
// Set a CompletionRoutine callback function.
//
WdfRequestSetCompletionRoutine(
RepeatReader->RequestPendingRead,
BthEchoRepeatReaderPendingReadCompletion,
RepeatReader
);
//
// Clear the stop event before sending the request
// This is relevant only on start of the repeat reader
// (i.e. the first submission)
// this event eventually gets set only when repeat reader stops
// and not on every resubmission.
//
KeClearEvent(&RepeatReader->StopEvent);
if (FALSE == WdfRequestSend(
RepeatReader->RequestPendingRead,
DevCtxHdr->IoTarget,
NULL
))
{
status = WdfRequestGetStatus(RepeatReader->RequestPendingRead);
TraceEvents(TRACE_LEVEL_ERROR, DBG_CONT_READER,
"Request send failed for request 0x%p, Brb 0x%p, Status code %!STATUS!\n",
//.........这里部分代码省略.........
示例11: I_SetVolumeCD
// volume : logical cd audio volume 0-31 (hardware is 0-255)
boolean I_SetVolumeCD (INT32 volume)
{
UNREFERENCED_PARAMETER(volume);
return false;
}
示例12: BthEchoRepeatReaderPendingReadCompletion
void
BthEchoRepeatReaderPendingReadCompletion(
__in WDFREQUEST Request,
__in WDFIOTARGET Target,
__in PWDF_REQUEST_COMPLETION_PARAMS Params,
__in WDFCONTEXT Context
)
/*++
Description:
Completion routine for pending read request
In this routine we invoke the read completion callback
in case of success and contreader failure callback
in case of failure.
These are implemented by server.
Arguments:
Request - Request completed
Target - Target to which request was sent
Params - Completion parameters
Context - We receive repeat reader as the context
--*/
{
PBTHECHO_REPEAT_READER repeatReader;
NTSTATUS status;
UNREFERENCED_PARAMETER(Target);
UNREFERENCED_PARAMETER(Request);
repeatReader = (PBTHECHO_REPEAT_READER) Context;
ASSERT((repeatReader != NULL));
status = Params->IoStatus.Status;
if (NT_SUCCESS(status))
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CONT_READER,
"Pending read completion, RepeatReader: 0x%p, status: %!STATUS!, Buffer: 0x%p, BufferSize: %d",
repeatReader,
Params->IoStatus.Status,
repeatReader->TransferBrb.Buffer,
repeatReader->TransferBrb.BufferSize
);
repeatReader->Connection->ContinuousReader.BthEchoConnectionObjectContReaderReadCompleteCallback(
repeatReader->Connection->DevCtxHdr,
repeatReader->Connection,
repeatReader->TransferBrb.Buffer,
repeatReader->TransferBrb.BufferSize
);
}
else
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_CONT_READER,
"Pending read completed with failure, RepeatReader: 0x%p, status: %!STATUS!",
repeatReader,
Params->IoStatus.Status
);
}
if (!NT_SUCCESS(status))
{
//
// Invoke reader failed callback only if status is something other
// than cancelled. If the status is STATUS_CANCELLED this is because
// we have cancelled repeat reader.
//
if (STATUS_CANCELLED != status)
{
//
// Invoke reader failed callback before setting the stop event
// to ensure that connection object is alive during this callback
//
repeatReader->Connection->ContinuousReader.BthEchoConnectionObjectContReaderFailedCallback(
repeatReader->Connection->DevCtxHdr,
repeatReader->Connection
);
}
//
// Set stop event because we are not resubmitting the reader
//
KeSetEvent(&repeatReader->StopEvent, 0, FALSE);
}
else
{
//
// Resubmit pending read
// We use a Dpc to avoid recursing in this completion routine
//
BOOLEAN ret = KeInsertQueueDpc(&repeatReader->ResubmitDpc, repeatReader, NULL);
ASSERT (TRUE == ret); //we only expect one outstanding dpc
//.........这里部分代码省略.........
示例13: GetClientRect
//****************************************************************************
void CBCGPDialogBar::OnScrollClient(UINT uiScrollCode)
{
#ifndef _BCGSUITE_
if (m_scrollSize == CSize(0, 0))
{
return;
}
CRect rectClient;
GetClientRect (rectClient);
CSize sizeScroll (0, 0);
switch (LOBYTE(uiScrollCode))
{
case SB_LEFT:
sizeScroll.cx = -m_scrollPos.x;
break;
case SB_RIGHT:
sizeScroll.cx = m_scrollSize.cx;
break;
case SB_LINELEFT:
sizeScroll.cx -= m_scrollLine.cx;
break;
case SB_LINERIGHT:
sizeScroll.cx += m_scrollLine.cx;
break;
case SB_PAGELEFT:
sizeScroll.cx -= rectClient.Width();
break;
case SB_PAGERIGHT:
sizeScroll.cx += rectClient.Width();
break;
}
const int nScrollButtonSize = GetScrollButtonSize();
if (m_scrollPos.x == 0 && sizeScroll.cx > 0)
{
sizeScroll.cx += nScrollButtonSize;
}
if ((m_scrollPos.x + sizeScroll.cx) <= nScrollButtonSize && sizeScroll.cx < 0)
{
sizeScroll.cx -= nScrollButtonSize;
}
switch (HIBYTE(uiScrollCode))
{
case SB_TOP:
sizeScroll.cy = -m_scrollPos.y;
break;
case SB_BOTTOM:
sizeScroll.cy = m_scrollSize.cy;
break;
case SB_LINEUP:
sizeScroll.cy -= m_scrollLine.cy;
break;
case SB_LINEDOWN:
sizeScroll.cy += m_scrollLine.cy;
break;
case SB_PAGEUP:
sizeScroll.cy -= rectClient.Height();
break;
case SB_PAGEDOWN:
sizeScroll.cy += rectClient.Height();
break;
}
if (m_scrollPos.y == 0 && sizeScroll.cy > 0)
{
sizeScroll.cy += nScrollButtonSize;
}
if ((m_scrollPos.y + sizeScroll.cy) <= nScrollButtonSize && sizeScroll.cy < 0)
{
sizeScroll.cy -= nScrollButtonSize;
}
ScrollClient(sizeScroll);
#else
UNREFERENCED_PARAMETER(uiScrollCode);
#endif
}
示例14: GetModuleHandle
void CDwmHelper::InitDwm()
{
BOOL lbDbg;
mh_User32 = GetModuleHandle(L"User32.dll");
//gOSVer.dwOSVersionInfoSize = sizeof(gOSVer);
//GetVersionEx(&gOSVer);
if (IsWin6())
{
user._ChangeWindowMessageFilter = (USER::ChangeWindowMessageFilter_t)GetProcAddress(mh_User32, "ChangeWindowMessageFilter");
if (user._ChangeWindowMessageFilter)
{
lbDbg = user._ChangeWindowMessageFilter(WM_DWMSENDICONICTHUMBNAIL, MSGFLT_ADD);
lbDbg = user._ChangeWindowMessageFilter(WM_DWMSENDICONICLIVEPREVIEWBITMAP, MSGFLT_ADD);
UNREFERENCED_PARAMETER(lbDbg);
}
mh_DwmApi = LoadLibrary(_T("dwmapi.dll"));
if (mh_DwmApi)
{
// Vista+
dwm._DwmIsCompositionEnabled = (DWM::DwmIsCompositionEnabled_t)GetProcAddress(mh_DwmApi, "DwmIsCompositionEnabled");
dwm._DwmSetWindowAttribute = (DWM::DwmSetWindowAttribute_t)GetProcAddress(mh_DwmApi, "DwmSetWindowAttribute");
dwm._DwmGetWindowAttribute = (DWM::DwmGetWindowAttribute_t)GetProcAddress(mh_DwmApi, "DwmGetWindowAttribute");
dwm._DwmExtendFrameIntoClientArea = (DWM::DwmExtendFrameIntoClientArea_t)GetProcAddress(mh_DwmApi, "DwmExtendFrameIntoClientArea");
dwm._DwmDefWindowProc = (DWM::DwmDefWindowProc_t)GetProcAddress(mh_DwmApi, "DwmDefWindowProc");
dwm._DwmSetIconicThumbnail = (DWM::DwmSetIconicThumbnail_t)GetProcAddress(mh_DwmApi, "DwmSetIconicThumbnail");
dwm._DwmSetIconicLivePreviewBitmap = (DWM::DwmSetIconicLivePreviewBitmap_t)GetProcAddress(mh_DwmApi, "DwmSetIconicLivePreviewBitmap");
dwm._DwmInvalidateIconicBitmaps = (DWM::DwmInvalidateIconicBitmaps_t)GetProcAddress(mh_DwmApi, "DwmInvalidateIconicBitmaps");
dwm._DwmEnableBlurBehindWindow = (DWM::DwmEnableBlurBehindWindow_t)GetProcAddress(mh_DwmApi, "DwmEnableBlurBehindWindow");
mb_DwmAllowed = (dwm._DwmIsCompositionEnabled != NULL)
&& (dwm._DwmGetWindowAttribute != NULL) && (dwm._DwmSetWindowAttribute != NULL)
&& (dwm._DwmExtendFrameIntoClientArea != NULL)
&& (dwm._DwmDefWindowProc != NULL);
if (mb_DwmAllowed)
mb_EnableGlass = true;
}
}
if (gOSVer.dwMajorVersion >= 6 || (gOSVer.dwMajorVersion == 5 && gOSVer.dwMinorVersion >= 1))
{
mh_UxTheme = LoadLibrary(_T("UxTheme.dll"));
if (mh_UxTheme)
{
// XP+
ux._IsAppThemed = (UX::AppThemed_t)GetProcAddress(mh_UxTheme, "IsAppThemed");
ux._IsThemeActive = (UX::AppThemed_t)GetProcAddress(mh_UxTheme, "IsThemeActive");
ux._OpenThemeData = (UX::OpenThemeData_t)GetProcAddress(mh_UxTheme, "OpenThemeData");
ux._CloseThemeData = (UX::CloseThemeData_t)GetProcAddress(mh_UxTheme, "CloseThemeData");
ux._DrawThemeBackground = (UX::DrawThemeBackground_t)GetProcAddress(mh_UxTheme, "DrawThemeBackground");
ux._DrawThemeEdge = (UX::DrawThemeEdge_t)GetProcAddress(mh_UxTheme, "DrawThemeEdge");
ux._GetThemeMargins = (UX::GetThemeMargins_t)GetProcAddress(mh_UxTheme, "GetThemeMargins");
ux._GetThemePartSize = (UX::GetThemePartSize_t)GetProcAddress(mh_UxTheme, "GetThemePartSize");
ux._GetThemePosition = (UX::GetThemePosition_t)GetProcAddress(mh_UxTheme, "GetThemePosition");
ux._GetThemeSysSize = (UX::GetThemeSysSize_t)GetProcAddress(mh_UxTheme, "GetThemeSysSize");
ux._GetThemeBackgroundContentRect = (UX::GetThemeBackgroundContentRect_t)GetProcAddress(mh_UxTheme, "GetThemeBackgroundContentRect");
ux._SetThemeAppProperties = (UX::SetThemeAppProperties_t)GetProcAddress(mh_UxTheme, "SetThemeAppProperties");
// Vista+
ux._BufferedPaintInit = (UX::BufferedPaintInit_t)GetProcAddress(mh_UxTheme, "BufferedPaintInit");
ux._BufferedPaintUnInit = (UX::BufferedPaintInit_t)GetProcAddress(mh_UxTheme, "BufferedPaintUnInit");
ux._BeginBufferedPaint = (UX::BeginBufferedPaint_t)GetProcAddress(mh_UxTheme, "BeginBufferedPaint");
ux._BufferedPaintSetAlpha = (UX::BufferedPaintSetAlpha_t)GetProcAddress(mh_UxTheme, "BufferedPaintSetAlpha");
ux._EndBufferedPaint = (UX::EndBufferedPaint_t)GetProcAddress(mh_UxTheme, "EndBufferedPaint");
ux._DrawThemeTextEx = (UX::DrawThemeTextEx_t)GetProcAddress(mh_UxTheme, "DrawThemeTextEx");
ux._SetWindowTheme = (UX::SetWindowTheme_t)GetProcAddress(mh_UxTheme, "SetWindowTheme");
mb_ThemeAllowed = (ux._IsAppThemed != NULL) && (ux._IsThemeActive != NULL);
if (mb_ThemeAllowed)
{
mb_EnableTheming = true;
if (ux._BufferedPaintInit && ux._BufferedPaintUnInit)
{
HRESULT hr = ux._BufferedPaintInit();
mb_BufferedAllowed = SUCCEEDED(hr);
}
}
}
}
if (IsWin10())
{
user._AdjustWindowRectExForDpi = (USER::AdjustWindowRectExForDpi_t)GetProcAddress(mh_User32, "AdjustWindowRectExForDpi");
}
}
示例15: ServiceMain
static VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv)
{
DWORD eventNo;
HANDLE pipe, device;
HANDLE eventConnect, eventUnmount;
HANDLE eventArray[3];
DOKAN_CONTROL control, unmount;
OVERLAPPED ov, driver;
ULONG returnedBytes;
EVENT_CONTEXT eventContext;
SECURITY_ATTRIBUTES sa;
UNREFERENCED_PARAMETER(dwArgc);
UNREFERENCED_PARAMETER(lpszArgv);
InitializeCriticalSectionAndSpinCount(&g_CriticalSection, 4000);
InitializeListHead(&g_MountList);
g_StatusHandle = RegisterServiceCtrlHandlerEx(L"DokanMounter", HandlerEx, NULL);
// extend completion time
g_ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
g_ServiceStatus.dwWin32ExitCode = NO_ERROR;
g_ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
g_ServiceStatus.dwServiceSpecificExitCode = 0;
g_ServiceStatus.dwWaitHint = 30000;
g_ServiceStatus.dwCheckPoint = 1;
g_ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
SetServiceStatus(g_StatusHandle, &g_ServiceStatus);
BuildSecurityAttributes(&sa);
pipe = CreateNamedPipe(DOKAN_CONTROL_PIPE,
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
1, sizeof(control), sizeof(control), 1000, &sa);
if (pipe == INVALID_HANDLE_VALUE) {
// TODO: should do something
DbgPrintW(L"DokanMounter: failed to create named pipe: %d\n", GetLastError());
}
device = CreateFile(
DOKAN_GLOBAL_DEVICE_NAME, // lpFileName
GENERIC_READ | GENERIC_WRITE, // dwDesiredAccess
FILE_SHARE_READ | FILE_SHARE_WRITE, // dwShareMode
NULL, // lpSecurityAttributes
OPEN_EXISTING, // dwCreationDistribution
FILE_FLAG_OVERLAPPED, // dwFlagsAndAttributes
NULL // hTemplateFile
);
if (device == INVALID_HANDLE_VALUE) {
// TODO: should do something
DbgPrintW(L"DokanMounter: failed to open device: %d\n", GetLastError());
}
eventConnect = CreateEvent(NULL, FALSE, FALSE, NULL);
eventUnmount = CreateEvent(NULL, FALSE, FALSE, NULL);
g_EventControl = CreateEvent(NULL, TRUE, FALSE, NULL);
g_ServiceStatus.dwWaitHint = 0;
g_ServiceStatus.dwCheckPoint = 0;
g_ServiceStatus.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus(g_StatusHandle, &g_ServiceStatus);
for (;;) {
ZeroMemory(&ov, sizeof(OVERLAPPED));
ZeroMemory(&driver, sizeof(OVERLAPPED));
ZeroMemory(&eventContext, sizeof(EVENT_CONTEXT));
ov.hEvent = eventConnect;
driver.hEvent = eventUnmount;
ConnectNamedPipe(pipe, &ov);
if (!DeviceIoControl(device, IOCTL_SERVICE_WAIT, NULL, 0,
&eventContext, sizeof(EVENT_CONTEXT), NULL, &driver)) {
DWORD error = GetLastError();
if (error != 997) {
DbgPrintW(L"DokanMounter: DeviceIoControl error: %d\n", error);
}
}
eventArray[0] = eventConnect;
eventArray[1] = eventUnmount;
eventArray[2] = g_EventControl;
eventNo = WaitForMultipleObjects(3, eventArray, FALSE, INFINITE) - WAIT_OBJECT_0;
DbgPrintW(L"DokanMounter: get an event\n");
if (eventNo == 0) {
DWORD result = 0;
ZeroMemory(&control, sizeof(control));
if (ReadFile(pipe, &control, sizeof(control), &result, NULL)) {
DokanControl(&control);
WriteFile(pipe, &control, sizeof(control), &result, NULL);
}
//.........这里部分代码省略.........