|
Hi,
I made it! I have read the document you passed me and decided to create a more open SDDL which I defined as:
DECLARE_CONST_UNICODE_STRING(
MY_SDDL,
L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GA;;;WD)"
);
And gave to the world GA permissions.
My question now is.. what are the implications of having a not so restrictive security options?
What are usually the SDDL for custom devices?
Thanks,
Nuno
|
|
|
|
|
sinosoidal wrote:
And gave to the world GA permissions.
My question now is.. what are the implications of having a not so restrictive security options?
What part about World (Everyone) having ALL access do you not understand? Did you read the articles I gave you in this previous response[^]? More specifically the How safe is your device namespace?[^] article which outlines a possible security hole scenario.
sinosoidal wrote: What are usually the SDDL for custom devices?
Have you tried SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R_RES_R?
"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GR;;;WD)(A;;GR;;;RC)"
Best Wishes,
-David Delaune
|
|
|
|
|
Hey guys .... i bought a new laptop(TOSHIBA AMD Turion Dual-core 3GB RAM) but it even doesnt act like a 256MB RAM ....it is very slow that I cant tell about it ...... my 1GB desktop runs much faster than the new laptop ..... by the way I usualy write C# codes on my laptop and listen musics ....... and it's operating system is VISTA.............. Please help me what to do about it
Thank you
There is no word Impossible in my mind dictionary
|
|
|
|
|
I have a requirement to be able to send a digital signal to a piece of hardware when a certain event happens in my software (and I'm not an electrical engineer by any means). I basically need a TTL pulse to go high for about 50ms and then back to zero. The hardware has a "16 channel digit I/O" that basically looks like a parallel port that I'll need to connect to, but I'm not sure what is the quickest, cheapest and cleanest way to go about generating the signal. It seems that the preferred method used to be to write to the parallel port of the computer, but the laptops we use don't have parallel ports and it is my understanding that writing to the parallel port is complicated in XP and later version of Windows by cutting off direct access and requiring a driver. I've seen USB-parallel adapters, but I have no experience with them.
Another thought I had was to use some like this, which connects to the USB port, comes with drivers and code samples that work in C# and seems very programmer friendly, but it has 8 outputs (when I need only 1) as well as inputs that I don't need (but might be useful for some other project perhaps?).
Does anybody have any ideas or advice they can share with the clueless?
|
|
|
|
|
Hi,
if all you need is one or a few signals (in or out, doesn't matter), the easiest and cheapest way would be through the control pins of a serial port, either a regular one or a USB-to-RS232C cable one.
Use the SerialPort class to open the port, and some of its properties to either read or write the control pins.
remarks:
- RS232C does not use TTL voltage levels; voltages may go anywhere from +15V to -15V so you may have to add resistors and a diode or zener diode.
- a better alternative would use an opto-coupler between your serial port and your target hardware.
- exact timing is not possible under Windows; generating a pulse that typically lasts some 30 milliseconds or more, should not be a problem. On average. When you're unlucky, your app will start the pulse and be kicked out for something more urgent Windows wants to do. You can reduce probability of this happening drastically by temporarily raising thread priority to real-time!
- serial ports based on USB-to-RS232C cable are bound to offer less control on timing, as they have to put their data and events in USB packets first.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks, sounds like a good suggestion. So if I'm understanding it correctly, I should be able to use a USB-serial adapter (we have a bunch of them lying around, so that shouldn't be a problem) and the SerialPort class and I should be able to control the DTR and RTS pins by using the SerialPort.DtrEnable and SerialPort.RtsEnable properties respectively. Is that correct?
Thanks for the heads up on voltage levels. I'll have to confirm exactly what the instrument I'm connecting to is expecting and then put something together to handle it. I have a guy who should be able to help me with that.
|
|
|
|
|
Wjousts wrote: I should be able to control the DTR and RTS pins by using the SerialPort.DtrEnable and SerialPort.RtsEnable properties respectively. Is that correct?
yes, as long as you don't enable hardware handshake on the port (then the driver would take over), so keep Handshake at None.
one more warning: as long as the port is not open, the output control lines will be at their default level, you'd better check that is acceptable for your peripheral device.
and one suggestion: you might consider pulling one input pin high/low at the far end, so your app can check to some extent your device is actually connected.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
If you want your pulse timing to be even remotely precise, I would suggest using a serial port. At 110 baud, a character code 0xE0 will generate a pulse that's about 54.5ms long; an 0xF0 would generate one about 45.5ms long. If the serial port will support non-standard baud rates, you could specify exactly 180 baud, in which case a 0x00 would yield exactly 50ms. Using RS232 levels, the line would idle at minus (typically) 9-12 volts, and the pulse would be +9-12; at TTL levels, the line would idle high and pulse low.
Note that sending characters back-to-back will generate pulses with a certain amount of time between them. Sending 0x00 at 180 baud would yield 50ms pulses with 33ms spacing. Using other baud rates and characters would allow different spacing, though I don't know how low serial ports can go (some serial-to-USB adapters may not even go down to 180). If you can only get down to 200 baud, you could try setting 8 bits space parity and sending 0x00. That would yield 50ms pulses with 5ms typical separation.
One advantage of using the serial-port data wire instead of the DTR line is that the data wire's pulse length will not be affected by code execution. If a user program turns DTR on and then triggers a garbage collection, the DTR wire may remain set for an arbitrarily-long length of time. By contrast, if the user code sends a byte out the serial port, the pulse length for that byte will be fixed no matter what else happens in the system.
|
|
|
|
|
I have a problem when trying to monitor CPU. My machine has Core2Duo CPU. But, when I'm trying to request number of processors using WMI, the return value is 1. Here's my code(VB .Net) :
Dim noCPU As Int64<br />
Dim mgtScr As ManagementObjectSearcher = New ManagementObjectSearcher("root\CIMV2", "Select * from Win32_ComputerSystem")<br />
For Each mgtObj As ManagementObject In mgtScr.Get<br />
noCPU = Convert.ToInt64(mgtObj("NumberOfProcessors"))<br />
Next<br />
mgtScr.Dispose()
Is my code right?How it's must be?After that, how can I get the CPU usage and CPU temperature from each processor / core?
I'm sorry, I can write in English very well, cause I'm an Indonesian
25160506848319
|
|
|
|
|
Hi,
the way Microsoft uses the terms core, processor, CPU is confusing me all the time.
What you probably want is hidden under NumberOfLogicalProcessors .
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi
I want to know the code/method/procedure how to write in boot sector of usb pendrive.
Thanks in advance
|
|
|
|
|
I am using intel D845GVSR chipset family motherboard, from last 1 week i am facing a problem related to sound issue.
My sound got disabled, no sound is coming from speaker.
I reinstall whole window XP, then after installing board drivers sound comes. then after restart it again got disabled. I dont know what is the reason.
In device manager, under sound option its not showing realtek device.
after fresh installation it shows the device, but as i install driver and restart my pc the sound device again got disabled.
On motherboard cd there is option for system info, there i saw a message that my audio device is disabled. I also checks my BIOS setting, there also audio is enabled.
I reinstalls Xp for 2-3 times, every time after few restarts(or as all drivers installation completes) sond got disaled.
Can anyone plz having a solution of this issue.
regards
|
|
|
|
|
Hi all,
This is my first post in quite a while - it's good to be back.
I have a series of related questions for the experts out there. There's quite a lot of stuff below, and I would really appreciate any advice that anyone can give on any of the questions I have. Feel free to point out anything that i've understood wrong or got mixed up. The questions really are my way of trying to follow through to the lowest level possible some stuff about communicating with hardware programmatically. I always find i want to understand what i'm doing to as high a level as possible. Just so you know at what level to phrase your responses, I write best in C# and C++ and have limited knowledge of C and Assembly code. I'm currently an undergraduate physicist at Uni, but the questions i have aren't at all related to my course. If possible, im looking to complete this project using C/C++.
My questions started when I was looking into controlling the parallel port from a program. I didn't care which language I used, but wanted to understand what was going on. I discovered the inp and outp methods in the conio file, but was pointed to the CreateFile and Read/WriteFile functions in the API by MSDN. My first question is:
Am i correct in presuming that the API calls end up using the same method as inp and outp to do their stuff?
Either way, I would like to know how these functions actually work. I was told by one of my tutors that the inp and outp functions are converted pretty much straight into a single op-code - at least, there's no lower level between inp/outp and assembly code as i imagine there would be if you used the win API (for some reason i imagine the api eventually goes thru to calling inp and outp and that we use the api because you cant interact directly with I/O ports in user code). Anyway, my second question is:
Does anyone know the assembly code for reading/writing to, say, the parallel port (traditionally port at address 0x378) or ports in general.
If i am forced to use the win API CreateFile, WriteFile etc functions, is it actually possible to use these to send a single bit to one of the pins of the parallel port so that it goes high? If so, how would i go about doing this? I think i know how to do it using outp, but im not so sure when using the API.
Whilst researching this stuff i ended up on DeviceManager. I was looking at the Resource tabs for different devices. I saw that I/O range (4 numbers) was available for Devices classed as Ports, such as the Parallel port (beginning at 0x378 for example) and that using the command line Debug program (in cmd.exe) i could query and edit the pins on various ports. I again presume Debug does this through the use of inp and outp, or the API?
However, i was looking at my audio device. Its property page points to the audio controller (under System Devices). Under the Audio Controller properties page, I can look at the Memory Range. This is now 8 numbers, and is not a port address. However, i wanted to know whether it was still possible to communicate with the Audio Controller using this memory range? How would i go about doing so?
If i cant do that then the audio controller points me towards the PCI Bus, device 27. The PCI bus does have an I/O Range so i could communicate with it this way, but i have no idea at what address the Audio Controller begins...How can i find this out? I obviously don't want to accidentally access the wrong device or port!
Of course, going so low has its advantages, but it would be simpler to access the audio device through its driver - i've no doubt that the manufacturers offer such functions, but i have no idea how to find out how to access them. The properties page for the audio device shows me the driver file, but i don't know where to go from here. I'm aware of COM objects and the information in the registry, but not sure how link the stuff together.
Finally, does microsoft offer some decent API documentation, such as a functions/files list which i could use instead of Prof. Google...? There must be decent documentation somewhere, or how does anyone get anything done using it?!
Thank you for your time and patience. Any help at all is greatly appreciated.
Yours,
Ed
Edit:
I've just found the article on controlling LED's using C# and the API functions there. Whilst this is a very good article, i'm still keen to have a deeper understanding of how these API functions work, what they end up calling (e.g. inp, outp) and the other questions in my post above. The functions used in that article are actually wrapped from some random site, and so again, i wish to go deeper in my understanding, and actually know how the stuff works!
|
|
|
|
|
i want to have specific driver which is loaded dynamic.
i mean that i hope to driver is loaded after finish OS booting.
actually i made usb filter driver (that is removeing usb storage driver) and this filter driver is working when IOmanger make IRP_MN_START_DEVICE.
but my usb filter driver is filt all usb IRP realted usb(mouse, keybord usb), i just want to check storage filter driver.
so i think that it is one way to control only storage driver.
some specific time , i will load this usb filter driver and then i can check only storage driver.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Hi buffering83,
You can install a an on-demand loading driver by defining the start type as SERVICE_DEMAND_START.
What Determines When a Driver Is Loaded[^]
This corresponds to the following i8042prt.sys registry key as an example:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\i8042prt\Start
You can browse your registry and see how other device drivers are loaded by looking at the Start key. Based on your previous questions here on codeproject however you seem to be developing a filter driver. Filter drivers typically belong to a load order group:
Load Order Groups for File System Filter Drivers[^]
The load order groups correspond with the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder\List
Best Wishes,
-David Delaune
|
|
|
|
|
i made usb filter driver and install it in the
"class regedit: 36FC9E60-C465-11CF-8056-444553540000"
so i checked that my filter driver is upperfilter.
i want to control storage usb not mouse or keybord usb.
and so i think that i can do control this when ioManager make irp_mn_start_device.
but my filter driver received all irps related about usb(keybord, mouse)
and i wnat to check only storage usb.
so can i know what kind of usb? by using flag or something?
//////////////////////////////////////////////////////////////////////
i mean that i want to check what is MOUSE USB or KEYBORD USB when irp_mn_start_device.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
modified on Tuesday, August 4, 2009 2:45 PM
|
|
|
|
|
Hi buffering83,
You have compiled a sample USB class filter driver. So quite naturally you are going to recieve IRP from all types of USB devices connected to the device class. Here is a diagram of USB mass storage device stack:
Device Object Example for a USB Mass Storage Device[^]
What are your driver requirements? What are you trying to accomplish?
|
|
|
|
|
i want to make USB control a program that
decide to approve USB storage.
when you insert USB Driver to pc, There is pop-up message which is asking you code.
if code is correct , your usb can be used.
but code is not correct , your usb can be terminated by device driver.
i make my usb filter driver, but i don't know how am i check .
i want to control only storage usb driver.
if you let me know your e-mail, i can send you my usb filter driver.
thank you for answering my question.
have a good day.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
blow word is some mouse filter driver's inf file.
how can i know that this MOUFLT file is filter driver?
i can't find any mean that MOUFLT Driver is filter driver...
/////////////////////////////////////////////////////////////////////////////////////////////////////////
[Version]
Signature="$CHICAGO$"
Class=Mouse
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
[Manufacturer]
%Mfg%=MfgDeviceSection
[MfgDeviceSection]
%DeviceDesc%=HajeSample, ACPI\PNP0F13
[HajeSample]
Include=msmouse.inf
Needs=HID_Mouse_Inst
CopyFiles=@MOUFLT.sys
[HajeSample.HW]
AddReg = HajeSample.HW.AddReg
[HajeSample.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"MOUFLT"
[HajeSample.Services]
AddService = MOUFLT,,Haje_Service_Inst
[Haje_Service_Inst]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_MANUAL_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\MOUFLT.sys
[SourceDisksFiles]
MOUFLT.sys=1
[DestinationDirs]
DefaultDestDir=12
[Strings]
ClassName = "Hajesoft"
DeviceDesc = "Hajesoft MOUFLT Driver"
DiskId = Sample Install Disk 1"
Mfg = "Hajesoft, Inc."
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER = 1
SERVICE_MANUAL_START = 3
SERVICE_ERROR_NORMAL = 1
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Hi buffering83,
buffering83 wrote: blow word is some mouse filter driver's inf file.
Normally I do not correct the english of non-native speakers but your misuse of blow might get you in trouble as this word has several slang definitions[^]. I believe the correct english word you are looking for is below[^].
Now lets address your question:
When you install a device the operating system identifies what type of device you are installing by using the Class GUID. Microsoft Windows defines many device setup classes:
System-Supplied Device Setup Classes[^]
If you open regedit you can navigate to the key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}
Under that key you will find the value UpperFilters.
The simple answer to your question is that the following lines in your INF:
[HajeSample.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"MOUFLT"
These INF lines when installed will instruct the operating system to load the device driver as an Upper Level Filter Driver[^] for the mouse device class.
Best Wishes,
-David Delaune
|
|
|
|
|
Fist of all thank you that answer.
and i have other question.
//as you can see INF file.
but book writer said
"MOUFLT driver is located between mouclass and i8042prt"
but i don't know how can i know that MOUFLT can be located between mouclass and i8042prt.
That INF file just show
Class=Mouse
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
[HajeSample.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"MOUFLT"
but there is notthing about mouclass or i8042prt.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
buffering83 wrote: but i don't know how can i know that MOUFLT can be located between mouclass and i8042prt.
Hi buffering83,
On your motherboard you have an 8042 microcontroller[^] and i8042prt.sys can read/write to this microcontoller using ports 0x60 and 0x64 available through the BIOS. This is essentially the PS/2 controller[^] to which a keyboard/mouse may be connected.
When you boot your computer your BIOS discovers the PS2 contoller and assigns IRQ1 and reserves ports 0x60 and 0x64 for the controller. When you boot your Windows operating system the Microsoft Plug and Play Manager[^] discovers through ACPI calls[^] that your computer has a PS2 contoller and will assign ACPI/PNP0303 and/or ACPI/PNP0F03 port drivers which is by default in your registry as i8042prt.sys You can search for the string PNP0303 or PNP0F13 and find the i8042 ACPI PNP driver entries.Note: This is an incomplete, very brief description of BIOS PnP/ACPI interaction.
buffering83 wrote: but there is notthing about mouclass or i8042prt.
The INF files may not contain any reference to mouclass or i8042prt. Your mouse filter driver is only concerned with GUID of the device class. Perhaps a visual representation will help you understand:
Have a look at the following diagram:
Types of WDM Drivers[^]
A more accurate description of your device stack is something like:
[Your Upper Filter]<--------------------+
|
|
[i8042 Function Driver] <-----> [Mouse Class Driver]
|
|
[Lower Filter]
|
|
[ACPI Root Bus Driver]
|
|
[Hardware Abstraction Layer]
|
|
[8042 microcontroller]
Your filter driver is designed to filter an entire device class. In other words... Your upper filter will filter anything that describes itself as a mouse.
Mouclass Driver Reference[^]
I8042prt Driver Reference[^]
Best Wishes,
-David Delaune
|
|
|
|
|
thank you sir~
have a nice day!
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
i want to make usb filter driver.
but i can't find how am i make...
some book just modify regedit file, and other book explan by using inf file.
(of course that book just show simple not detail.)
what i want to is
when insert USB to usb port , some application(which make me) know about this insertion and pop up some message box.
so i think that first i have to do is make simple usb filter driver and insert usb filter driver to device stack.
but i don't know how can do it.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
|