Ive been trying to send raw ATA commands via WdfIoTargetSendIoctlSynchronously using the ATA_PASS_THROUGH_EX32 structure and IOCTL_ATA_PASS_THROUGH IoControlCode. What I've noticed is any commands other than IOCTL_DISK_GET_DRIVE_GEOMETRY seems to fail from inside a KMDF driver for me.
I've build a standard 32bit executable and can use IOCTL_ATA_PASS_THROUGH perfectly fine. The driver doesn't get any errors other than STATUS_INVALID_PARAMETER from the NTStatus return value of WdfIoTargetSendIoctlSynchronously.
Does anyone have any ideas?
Steps Taken:
WdfIoTargetCreate
WdfIoTargetOpen
WdfRequestCreate
WdfMemoryCreate -> WDF_MEMORY_DESCRIPTOR_INIT_BUFFER -> ATA_PASS_THROUGH_EX32
WdfMemoryCreate -> WDF_MEMORY_DESCRIPTOR_INIT_BUFFER -> OutputBuffer
WdfIoTargetSendIoctlSynchronously
Related
Output display user input integer, instead of Even or Odd
import 'dart:io';
void main() {
print('Enter your number: ');
int n = int.parse(stdin.readLineSync()!);
var result = n % 2 == 0 ? "Even" : "Odd";
print('Your number is : $result');
}
The problem is that your program is running inside the "Debug Console" in VS Code. The following explanation can be found in the Dart settings in VS Code:
The Debug Console has more functionality because the process is controlled by the debug adapter, but is unable to accept input from the user via stdin.
You can change this by going into File -> Preferences -> Settings. Here you go into Extensions -> Dart & Flutter. If you scroll down you can find "Dart: Cli Console". You can also just search for "Dart Cli console":
Instead of "debugConsole" set this to "terminal". Try start your program again and it should now be running inside the "Terminal" tab instead and you should be able to interact with your program and provide data to it though keyboard inputs.
I am using ThingWorx to reach out to my Raspberry Pi and try to retrieve motion data from a PIR Sensor connected to the Raspberry Pi. It communicates via Lua Script. To test it out I created a Lua Script separate from the ThingWorx server and used the 'periphery' module to access the input from the GPIO pin. It works fine. But when running the script through the EMS for ThingWorx, I get the error 'Error: error loading module 'periphery' from file 'usr/local/lib/lua/5.1/periphery.so: undefined symbol: lua_gettop'
Here is a snippet of the code that works on its own but not when used for the EMS:
local GPIO = require('periphery').GPIO
local GPIO_in = GPIO(4,"in")
local value = GPIO_in:read()
Edit: I did not solve that particular error, but I solved my issue by just running the lua script on its own, sending that data to a txt file, then in the lua script for the EMS, I just read the data from the txt file to be able to send to ThingWorx.
I'm trying to execute a simple erlang program of adding two numbers.
I'm trying to do this in Eclipse on Ubuntu 10.04 LTS.
When i execute this program, I'm getting the error as shown below:
** exception error: undefined function add:addfunc/0
How do i go about solving this error? Thanks in advance.
This program when executed in the erlang shell is working fine. But when it comes to eclipse it's giving me this error. Not this, any program for that matter is giving me the similar error. Guess I would be missing something about the eclipse configuration.
EDIT:
Anyways, This is the sample add program,
-module(add).
-export([addfunc/0]).
addfunc() ->
5 + 6.
This message tells you that module add doesn't have an exported function addfunc/0.
Ensure the function you want to be called has exactly that name, doesn't expect any
parameters, is
exported, the module is
compiled, the search path includes the compiled beam file and that there is no module clashes using code:clash()
Update
It's not clear how erlide (eclipse erlang plug-in you seem to use) compiles and runs a program. Try to compile source using erlc or inside erl shell. That way you'll have much easier controllable environment and you'll better understand what's going on.
I got exactly the same problem -for a tail recursive fibonacci function- below:
-module(math2).
-export([fibonacci/1]).
fibonacci(0) -> 0;
fibonacci(1) -> 1;
fibonacci(M) -> fibonacci(M-1) + fibonacci(M-2).
In the end, had realized that this is a compile-time exception. Then, have opened a new tab on my shell and tried with erlc, instead of erl.
$ erlc math2.erl
Now I am also able to see math2.beam file created.
Called fibonacci with 10:
4> math2:fibonacci(10).
55
and it worked!
I think you have not compiled the code and you are trying to run the program.
In eclipse, using the "Run" icon, trigger the run; which will get you to the erl shell in the console window.
There you do -
cd("C:\Learning_ERL\src").
And you should see output like-
(Learning-ERL#DALAKSHM-MNFSM)7> cd("C:\Learning_ERL\src").
c:/Learning_ERL/src
ok
Then compile the code -
c(add)
you should see something like this on the erl shell-
(Learning-ERL#DALAKSHM-MNFSM)10> c(add).
{ok,add}
Now you should be seeing a new file called - add.beam in the same directory as that of your erl source file - add.erl
add.beam is a bytecode file
Now you should be able to run the program without any error
How do you try to execute your code?
In your editor, right-click and choose "Run as"->"Erlang application". The VM that is launched will have your project loaded automatically and when editing/saving a file it will get reloaded. When launching, a console appears and you can call your code from there.
If it still doesn't work, what message do you get for m(add).?
I had ejabberd 13.12, all works great until I physically moved server machine to another network, then jabber server start encounting crashes. (the same types and details of networks)
CRASH REPORT Process <0.4260.0> with 0 neighbours exited with reason: call to undefined function
ejabberd_socket:get_conn_type({socket_state,gen_tcp,#Port<0.5852>,<0.4259.0>}) in p1_fsm:terminate/7 line 733
2014-01-23 09:34:42.548 [error] <0.330.0> Supervisor ejabberd_c2s_sup had child undefined started with
{ejabberd_c2s,start_link,undefined} at <0.4260.0> exit with reason call to undefined function
ejabberd_socket:get_conn_type({socket_state,gen_tcp,#Port<0.5852>,<0.4259.0>}) in context child_terminated
after machine migration the statuses of users was changed randomly.
I tried reinstall jabber server and I used ejabberd 2.1.13 compiled from scratch - what give me the same errors while using jabber.
function is:
get_conn_type(StateData) ->
case (StateData#state.sockmod):get_sockmod(StateData#state.socket) of
gen_tcp -> c2s;
p1_tls -> c2s_tls;
ezlib ->
case ezlib:get_sockmod((StateData#state.socket)#socket_state.socket) of
gen_tcp -> c2s_compressed;
p1_tls -> c2s_compressed_tls
end;
ejabberd_http_poll -> http_poll;
ejabberd_http_bind -> http_bind;
_ -> unknown
end.
I want understand this function (good pythoner, never erlang) and add hack or pinpoint the issue: is sth ejabberd specific or sth with sockets (but others network tools/services works perfect).
a) how can I insert to that function interactive debugger and get interactive introspection of stack and variables there.
The error message you're seeing says that the get_conn_type function doesn't exist in the ejabberd_socket module. And this is true; in the standard ejabberd distribution, get_conn_type lives in the ejabberd_c2s module.
If you are positive that neither you nor anyone else has modified the sources, then I would check your installation of Erlang. Perhaps it's broken, or you're using different versions to compile and run the code.
I am trying to run xUnit tests (from an F# module, if it makes any difference) using TestDriven.NET, but whatever I do I get this error:
It looks like you're trying to execute an xUnit.net unit test.
For xUnit 1.5 or above (recommended):
Please ensure that the directory containing your 'xunit.dll' reference also contains xUnit's
test runner files ('xunit.dll.tdnet', 'xunit.runner.tdnet.dll' etc.)
For earlier versions:
You need to install support for TestDriven.Net using xUnit's 'xunit.installer.exe' application.
You can find xUnit.net downloads and support here:
http://www.codeplex.com/xunit
I tried following the suggestions, i.e. I copied the files
xunit.dll.tdnet
xunit.extensions.dll
xunit.gui.clr4.exe
xunit.runner.tdnet.dll
xunit.runner.utility.dll
xunit.runner.utility.xml
xunit.xml
to the folder with xunit.dll and I ran xunit.installer.exe. How can I get it to work?
I just figured out that I forgot to make the test a function in F# (so it was just a value). The error message can't be more misleading though!
You have two problems:
your Fact is broken:-
If you hover over the
please work
bit, you'll see something like: unit -> int
For a Fact to be picked up by an xUnit runner, it needs to yield `unit (void).
Hence, one key thing to get right first is to not return anything. In other words, replace your 123 with () (or an Assertion).
You can guard against this by putting a :unit stipulation on the test:-
[<Fact>]
let ``please work`` () : unit = 123
This will force a compilation error.
TestDriven.NET is reporting it cannot find the xunit.tdnet modules
It's critical to get step 1 right first. Then retry and the problem should be gone
If it remains...
Either try the VS-based runner which should work as long as it's installed and xunit.dll is getting to your output dir or look at the docs for your version of TD.NET for detailed troubleshooting notes (exec summary is if the .tdnet file was in your out dir or you undo and redo the xunit.installer from the folder containing the packages it should just work, esp if you are on latest)