|
In that case, you don't have a file in PE format that exposes an exports table. There's no way to import the functions in that file using normal methods.
SYS files do not have a set format. They are either text files, memory-image format, PE format, or some other data.
You can find out if your SYS file has any exports by opening it up using Dependancy Walker[^].
|
|
|
|
|
I do have exports and see them by opening the sys file with the Dependyncy Walker (they are listet as Function)
How can i call these exports (functions) with c#?
|
|
|
|
|
You do have the documentation on those functions, correct? Without it, you'll find calling them impossible because you won't know how many and of what type parameters to pass to the functions. You cannot get that information from the file.
Have you specified the full path to the file in the DllImport line and told it what the EXACT function name is (case matters)?
|
|
|
|
|
The documentation is correct!
For testing i only use a function which has no parameters!
I also tested with the full path (but the file is located in the running direcotry) but alos did not work!
Should it be possible to call functions from this Export-Driver ("Sample.sys") from a c# project?
How does it work in C++?
|
|
|
|
|
Truthfully, never tried it.
|
|
|
|
|
Stop wasting his time, it cant be done.
Morality is indistinguishable from social proscription
|
|
|
|
|
Wasting time?? You do realize this thread is almost a month old?
I realize you can't do it now. At the time, I honestly didn't know and didn't have the time to try it. I simply told him how to try it himself. If it didn't work for him, great, then we both know. But, he at least learned how to TRY it for himself.
|
|
|
|
|
Well, if you are still interested / have not found out yourself yet...
you definitely can NOT call functions exported from a driver from within a
C# app / dll directly. This doesn't work because the C#-application is running
in user-mode (a cpu mode for user applications that e.g. doesn't allow you to
shut down the machine etc.) and the driver whose methods you are trying to call,
is running in kernel mode. I don't know how much experience you actually have
with programming kernel mode drivers please don't get me wrong if you know it already,
but you can accomplish what you need to by sending IOCTLs (IO control codes) to your
driver from the c# application / dll. (This works by calling Win32 API DeviceIoControl()...
you can easily look up the signature for this one in the SDK documentation)
And for the export driver ... you'd better use a normal driver, load and start it or let it be
loaded and started by the OS to send IOCTLs to it afterwards.
But for now, have some nice days,
whish a good new year, Eric
|
|
|
|
|
Well, if you are still interested / have not found out yourself yet...
you definitely can NOT call functions exported from a driver from within a
C# app / dll directly. This doesn't work because the C#-application is running
in user-mode (a cpu mode for user applications that e.g. doesn't allow you to
shut down the machine etc.) and the driver whose methods you are trying to call,
is running in kernel mode. I don't know how much experience you actually have
with programming kernel mode drivers please don't get me wrong if you know it already,
but you can accomplish what you need to by sending IOCTLs (IO control codes) to your
driver from the c# application / dll. (This works by calling Win32 API DeviceIoControl()...
you can easily look up the signature for this one in the SDK documentation)
And for the export driver ... you'd better use a normal driver, load and start it or let it be
loaded and started by the OS to send IOCTLs to it afterwards. For more questions on driver
development, take a look at http://www.osronline.com .
But for now, have some nice days,
I wish you a good new year, Eric
|
|
|
|
|
You cant access kernel mode files this way at all.
Morality is indistinguishable from social proscription
|
|
|
|
|
Firstly you may get more assistance by posting this question in the C# forum. Secondly, what does the documentation for this DLL say about using these functions in C#?
|
|
|
|
|
Are you sure that the function is declared as cdecl (CallingConvention = CallingConvention.Cdecl)
Typically Windows exports are stdcall. (this matters only the function has parameters)
What function exactly are you trying to export? Can you post the full signature and driver name (??.sys) here please?
|
|
|
|
|
You cant do it.
Not at all. It cant be done. Not in C#, C++VB, assembler, C, machine code, magic wands, anything,
The ONLY way to talk to kernel mode components is via the handle created by CreateFile() and then, you can only access kernel components that actually create a symbolic link accessible from user mode, and all kernel mode dlls, (in fact there arent that many) wont.
A sys file is NOT a dll. Its a library of functions that bridge parts of the OS and device.
Morality is indistinguishable from social proscription
|
|
|
|
|
Has anyone here any specific experience with touch screen technology as far as the hardware goes?
I am starting a project that is going to utilize them and am looking for some real world feedback on the differences in image quality, length of service, and accuracy of the resistive types vs. the capacitive types.
My environment is going to be a DRs office, most likely fluorescent lighting, maybe some direct sunlight that can effect contrast, etc... but nothing mobile. Small (7-8 inch) screen size) using a finger or stylus if I have to, but would prefer direct touch.
I am interested in opinions\experience on sensitivity and Mean Time Between failures (MTBF).
Also, if you have any recommendations on specific vendors that have been good\great\abysmal that would also be a great help.
Thanks... first time asking a HW related question here so I am wondering if anyone is even going to see it
|
|
|
|
|
With a traditional mouse having a scroll wheel, clicking the wheel turned the cursor into a circle with up/down arrows. A friend of mine was telling me the same thing has happened with her Vista laptop. When either of the left/right buttons on the touchpad are clicked, nothing happens except for the "circle with up/down arrows" cursor shows up. Any cues on how to remedy this?
Thanks.
- DC
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I tried every combination I could to see if this would work but no luck. However, when I looked at Control Panel -> Mouse, I found a settings option to select the action to take on left/right button. One of the options allows it to emulate the "middle click"; so I guess that may be the place to look. btw I have Synaptics TouchPad on my laptop, but I guess the other makes are fairly similar.
|
|
|
|
|
I'm trying to get the Unique Serial Number of an SD (Secure Digital) Memory Card, I know how to get the volume information and the like. From reading the specification for the SD Card, I do know each has such an Unique ID. After doing many search here, google, and other web sites I haven't been able to find the answer.
Thanks as always for any help you can provide
|
|
|
|
|
quit cross-posting please - you posted this same question in C# forum
'g'
|
|
|
|
|
The RAID controller on my Dell PowerEdge 4600 server may be failing and the server is out of warranty. Does this mean we need to buy a new server? If so, can we still use the server as a workstation to run programs from an external hard drive or can I buy a new motherboard and move the CPUs and memory to it? What are my options? I hope that I would at least be able to move the operating system and memory onto a new server I buy, and possibly create a new desktop for someone using the Xenon processors.
The server has dual socket Xenon CPU (8 cores total) and 10GB RAM.
modified on Monday, December 14, 2009 1:39 AM
|
|
|
|
|
Ted2102 wrote: Does this mean we need to buy a new server?
not necessarily - that depends on wether the RAID controller is on the motherboard or not - if its not, then you may be able to order a replacement RAID controller board ...
I'd first of all, before ALL else, make sure your data is backed up while the machine is still talking to you...
I forget what its called, but Dell usually install a diagnostics package which includes the raid/disk manager - that may tell you what you need to know about the board
BUT BACK YOUR DATA UP NOW, dude
'g'
|
|
|
|
|
Thanks, I have hourly backups scheduled. PERC 3/DI controller. I think the RAID 5 controller is on the mother board.
The user guide says "An on-board ROMB is activated by using a 128-MB cache memory module, a RAID key, and RAID battery.
An optional integrated dual-channel RAID controller card supports RAID levels 0, 1, 5, and 10."
modified on Monday, December 14, 2009 3:01 AM
|
|
|
|
|
3/DI is on the mother board. But what Garth said is still valid though. The built in controller can be disabled and you can install a new controllercard.
I would get in touch with Dell and find out if they have any PERC 3/DE controllers available, then maybe you won't have to reinstall the server as it uses the same driver.
|
|
|
|
|
sorry - I was out at the physio and then to dinner, so I didnt get a chance to follow up - iirc, Perc 3/DI is 'Integrated/Internal', 3/DE is 'External' (To The Motherboard)
So, the 3/DI Could be disabled (reboot the system, watch the prompts and it should tell you which keys to get into the controller), and a replacment put in - Dell used to use some other brand or make American Megatrends Cards avail on request - these were slightly better becuase they had a Recover Config option.
As Jörgen Andersson points out, I think your best bet is still with Dell to start with - Dell have been pretty good to us in the past, (ok, the scale is different, we are a large corporate), but even if you get a replacement motherboard, it would be interesting to copy the raid config without their help (I cant remember how it works/where its stored)
If you could lay your hands on another P/E 4600 with motherboard, memory, but no DASD/Disk, you might be able to set it up as per your current system, then move your DASD/Disks across to it
At least you have backups, it really depends on what hardware you can lay your hands on - I dont think its a total loss yet.
Last of all, I hate to be a p.i.t.a. - keep your maintenance up to date - it might be $$ xyz per year, but how much is this exercise going to cost you in lost productivity, or worse (hopefully not) lost data
'g'
|
|
|
|
|
I have an externally powered USB device, and sometimes I get a "Device attached to the system is not functioning" error. I've been debugging and googling this for a couple days now, and I'm just not getting anywhere anymore.
I've found the unplugging and replugging the USB will usually resolve this. I know toggling the Vcc line on the UBS port will prompt the device to reset its USB state. I can't physically disconnect the device because it could be running as part of an unattended test and may need to be reconnected like this (I'm logging any USB errors I encounter and the conditions so we can debug them later).
Is there a way I can toggle the USB power signal via C# or a Win32 API call?
NOTE: I can pretty consistenly get this to happen in XP, not as often on 7 or one Vista laptop. Other Vista laptops I've tried have never seen this problem, even running the exact same version of the PC code. But since i can get it to happen on multiple computers with different setups, I don't think its a PC issue.
Any help is appreciated.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
What happens if you disable the device in device manager? Does it even appear there?
I don't think the power can be switched off on individual USB ports (if it's possible at all to control power to the ports). On my motherboard, the power is permanently on, even when shut down.
There is a tool here[^] that allows you to control devices from the command line, it may help if enabling and disabling fixes the issue.
Also, you could look into the WDK[^], but I doubt there is anything that allows direct control of USB power.
<edit>
http://msdn.microsoft.com/en-us/library/ms798253.aspx[^]
Looks like I was wrong about the WDK, it can be done (per device, not the port directly), but in kernel mode.
</edit>
modified on Monday, December 21, 2009 8:34 AM
|
|
|
|
|