Forum Replies Created
-
AuthorPosts
-
airmaxParticipant
Please, try suggestion from here viewtopic.php?f=1&t=587 and confilrm is it help.
airmaxParticipantAs author explained in the past, it’s not hides to tray because of security reasons.
airmaxParticipantCheck also this reply:
viewtopic.php?f=4&t=498&p=1168#p1168airmaxParticipantDebug menu items not appear if solution consist of several solutions, and driver project is inside one of them.
For example:ComplexSolution -Solution1 --DriverProject <-- --Project12 -Solution2 --Project21 --Project22
VS2010, VisualDDK 1.5
airmaxParticipantDoes you setup boot in debugging mode using COM port on “Target machine”?
airmaxParticipant@bazis wrote:
Unfortunately, I don’t have much time to look into details right now. However, I don’t think that relying on undocumented _CxxThrowException(), that can be changed in future versions, is a good idea.
Yes, but this is another question, lets assume this is not problem.
@bazis wrote:
Moreover, I don’t explicitly see whether your example is compatible with x64.
Oh, i give incorrect link. Actual branch is x64. So, as i see from eh.cpp and ehsup.asm code, its will work on x64 too:
http://code.google.com/p/ontl/source/browse/branches/x64/ntl/rtl/eh.cpp
When you will have some time, plz have a look and tell your opinion.@bazis wrote:
I would suggest redefining __THROW_BAD_ALLOC using SEH. As SEH is already supported by WDK, that should not be a problem. We won’t get a full equivalent of C++ exceptions, however, this particular problem (handle npagednew() for STL containers) will be solved smoothly.
Thanks for suggestion! I like this idea too. Going to use it.
Also will research on EH implementation above. Support for local objects destruction very important, so RAII principles are not broken.airmaxParticipantYes, you correct.
_alloc.h:# define __THROW_BAD_ALLOC puts("out of memoryn"); exit(1)
stlsup.cpp:
void _cdecl exit(int _Code) { KeBugCheck(STATUS_INTERNAL_ERROR); }
Also, i want to ask non BazisLib related question 🙂
I start using C++ and STLPort in NDIS driver, where most of calls on DISPATCH_LEVEL, so, memory must be allocated from NonPaged pool. When allocating memory from NonPaged pool frequently (for example, for packet modifying) chances to have out of memory are high.Exception handling support will help in this case. Lets assume, that exceptions stack usage overhead isn’t a problem.
What you think about this implementation http://code.google.com/p/ontl/source/browse/trunk/ntl/rtl/eh.cppMaybe another ideas?
airmaxParticipantOk, thanx. I will try this approach.
airmaxParticipantAlso, small memory optimization can be added by placing DriverEntry to INIT section, so it will be unloaded after driver start:
#ifdef ALLOC_PRAGMA #pragma alloc_text (INIT, DriverEntry) #endif // ALLOC_PRAGMA
Also, i think that cmd files which use system build in utility sc to register/run/stop/remove legacy driver will be more flexible than registry file.
airmaxParticipantIt is managed by BazisLib. You can see the stlsup.cpp file for new() and delete() implementation.
So, if i understand correctly, i can use new/delete/npagednew in KM C++ if i include stlsup.cpp?
Just try DDKWizard, why you not use RTL_CONSTANT_STRING to define DeviceName and Win32Device instead of RtlInitUnicodeString?
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\Device\DevName"); UNICODE_STRING Win32Device = RTL_CONSTANT_STRING(L"\DosDevices\DevName");
airmaxParticipantBtw, i just try BazisLib::DDK Driver Wizard.
As i see its generate new and delete insructions, is this is ok? I reed they must be avoided. Or its controlled by included basizlib?airmaxParticipantThanks for advice.
airmaxParticipantThanks for advice.
I read a lot of info about C++ in KM, and now i completely mesh.Somewhere i read that, to use C++ in KM “C++ runtime” required, for example htscpp from hollistech or CppLib. So, i can’t get, i need it or not?
airmaxParticipant😳 I misread “as in” i read as “and in” and think that you underrate yourself. Quite the contrary i see, researching lib, you have good experience of KM development.
I have about 4 years of driver development experience, but still not write own framework or lib(set of C functions is not framework).Also, i have no C++ kernel driver development experience(Generally, have small. Using NuMega DriverStudio, and thats not best experience because of problems i have using it).
So, im serious to try C++ in KM. Btw, can i use STLPort provided by installer separately? Or its uses as part of BasizLib only?
Sorry, one more question. Can you please give some advices of C++ usage(Compiler flags, objects creation, something also)?airmaxParticipant@bazis wrote:
.. as in kernel development 😉
😆
-
AuthorPosts