how to get process id from IAudioSessionManager2 - winapi

Background: enum all active sessions that are using system audio.
I am trying to get process information from IAudioSessionManager2. But I can't find such function. Does anyone know how to get it?
Sample code:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd368281(v=vs.85).aspx
IAudioSessionControl only provides such methods: GetDisplayName, but the display name I got is just null.

You must use the IAudioSessionControl2 interface and the GetProcessId method.

Related

SonarJs still shows warning about postMessage cross-domain issue

The error message is "make sure this cross-domain message is being sent to the intended domain".
This check rule from RSPEC-2819
Authors should not use the wildcard keyword ( *) in the targetOrigin argument in messages that contain any confidential information, as otherwise there is no way to guarantee that the message is only delivered to the recipient to which it was intended.
I assume it demands * cannot be used as targetOrigin, But It still shows warning when I use intended domain as targetOrigin like below:
Please somebody can tell me how to pass this check,
Any help would be appreciated
This rule detects only if a method postMessage is invoked on an object with a name containing window in it. Source code: PostMessageCheck.java. To bypass it, just assign your contentWindow object into different one, like this:
var content = this.elem.contentWindow;
content.postMessage('your message', window.location.origin);
Have faced similar issue in sonarQube. Below fix worked. Just get rid of using window object using directly.
Actual code:
window.parent.postMessage("data", parenturl);
Fix:
var content=window;
content.parent.postMessage("data",parenturl);

How do I call the evernote struct object to report all notes inside a notebook?

I am working through the ruby evernote-thrift API and sandbox.
I am experiencing some issues interpreting the docs; I am trying to retrieve the subject line from all the notes inside a particular notebook.
To get the name of the notebook I call
notebooks = noteStore.listNotebooks(authToken) and then run .each on notebooks. According to the docs there is a struct object called noteList but I can’t figure out how to use it.
this is the link to the docs area I am trying to leverage http://www.rubydoc.info/gems/evernote-thrift/Evernote/EDAM/NoteStore/NoteList#struct_fields-instance_method
my attempt, is as follows, but its not returning anything. unfortunately im not familiar with structs at all.
notebooks = noteStore.listNotebooks(authToken)
notebooks.each do |notebook|
next if notebook.name != 'First Notebook'
notes = notebook.noteList
noteList.each do |note|
puts note
end
end
i am getting a no method error... which makese sense because its a struct I just dont know how to leverage it...
undefined method `noteList' for <Evernote::EDAM::Type::Notebook:0x007fb2041683f8> (NoMethodError)
The generated docs for our Ruby SDK are confusing (sorry!), but I find the general docs to be much clearer: https://dev.evernote.com/doc/reference/.
As you can see in https://dev.evernote.com/doc/reference/Types.html#Struct_Notebook, the Notebook object does not have an attribute called noteList. There is a struct called NoteList, but that was what the removed NoteStore.findNotes returned.
The procedure for getting the titles/subjects of the notes in a notebook is to get the Notebook (which you have done), then pass the notebook's guid into NoteStore.findNotesMetadata (https://dev.evernote.com/doc/reference/NoteStore.html#Fn_NoteStore_findNotesMetadata). This returns a NotesMetadataList which has a notes attribute which is a list of NoteMetadata. This struct has metadata like title and GUID but not the body. If you want the full information, you would pass the GUID into NoteStore.getNote (https://dev.evernote.com/doc/reference/NoteStore.html#Fn_NoteStore_getNote).
That API is one of the least Ruby things I've ever seen. You have my condolences for trying to trudge through that :)
From the API docs, all I'm seeing that hangs off of that Evernote::EDAM::Type::Notebook class are #struct_fields and #validate, as far as instance methods go. Perhaps that struct_fields has what you're looking for?
If that doesn't lead you anywhere, I'd suggest doing using something like Pry to help you troubleshoot the error. I'd put a binding.pry statement on the second line and then explore the notebooks objects from there.

insertNewChild is not a function in DHTML Tree grid Pro

I want to access child data from server when we append parent. Now I am using
mygrid.attachEvent("onOpenStart", getSubElements );
When I am using getSubElements, this method then it is showing an error: inserNewChild is not a function.
I am using this line, please review this and let me know where I am doing wrong.
mygrid.insertNewChild("a0J9000000TTdLtEAL","a0J9000000TTdKz","CLASS.000010",0,0,0,0,"");
Please note that the insertNewChild() is the method of the dhtmlxTree, and won't work in dhtmlxTreegrid.
http://docs.dhtmlx.com/api__dhtmlxtree_insertnewchild.html
You may use the addRow() method:
http://docs.dhtmlx.com/api__link__dhtmlxtreegrid_addrow.html
Also please try to use the onOpenEnd event instead of onOpenStart:
http://docs.dhtmlx.com/api__dhtmlxtreegrid_onopenend_event.html

How to make jmeter while controller work

I'm having trouble getting the while controller to work in jmeter.
I've a feeling that I read that it doesn't re-evalute user defined variables, so I am trying to use properties instead.
I start off by using a BSF assertion to set a property called keepLooping
${__setProperty(keepLooping, true)};
This seems to work as it enters the While controller with a condition of
${__property(keepLooping)}
But I cannot for the life of me get it to change that property to something else. I want it to change the property depending on the resulting text of an http request.
So I am using a Regular Expression Extractor to set a variable, which I can see is getting set. Then I am trying to use a BSF assertion to set the keepLooping property on the basis of the variable that I have set. I am using javascript as follows:
log.info("IM IN HERE");
log.info("props is "+props);
//log.info("props keep looping is "+props["keepLooping"]);
if (${surveyRequired} == false){
log.info("IM IN HERE 1A and props is "+props);
${__setProperty(keepLooping, true)};
log.info("IM IN HERE 1B");
}
else {
log.info("IM IN HERE 2A");
${__setProperty(keepLooping, false)};
log.info("IM IN HERE 2B");
}
I can't figure out how to set the property with javascript - I've tried several things. Can anyone help? Many thanks!
Also can anyone recommend a good resource that negotiates what seem to be the many 'quirks' of jmeter? Many thanks!
"I've a feeling that I read that it doesn't re-evalute user defined variables" -- I use JMeter 2.9 and it really does. I use user defined variable in order to count number of loops. It looks like: ${__javaScript(${MY_USER_DEFINED_VARIABLE}>0)}. The only one annoying thing is that I have to get value of variable, increment it, cast to string (toString() in Groovy), and then put new value into MY_USER_DEFINED_VARIABLE (by using vars.putObject("MY_USER_DEFINED_VARIABLE",localBSFVariable))
Using vars.put or props.put will help, as explained in detailed in detail in this jmeter thread.

Firefox (Gecko) code - interrogating the cache - how do I get a list of devices?

Referring to nsICacheService (https://developer.mozilla.org/en/NsICacheService) and nsICacheVisitor (https://developer.mozilla.org/en/nsICacheVisitor):
Where do I get an instance of nsICacheVisitor?
Where do I get a list of devices so that I can call visitEntry() and visitDevice()?
The nsICacheVisitor is an interface that you implement and pass to the visitEntries method on nsICacheService. See this test file for example code.

Resources