Sysprogs forums › Forums › Other tools & products › BazisLib 2.3.0 Setup Error [FIXED]
- This topic has 15 replies, 2 voices, and was last updated 15 years, 2 months ago by support.
-
AuthorPosts
-
October 1, 2009 at 19:30 #102airmaxParticipant
After BazisLib-2.3.0.exe finises, its seems it call BazisLibSetup.exe from target directory.
BazisLibSetup.exe causes error on load:I press debug and here is some data from VS:
Call stack:> System.Windows.Forms.dll!System.Windows.Forms.ComboBox.ObjectCollection.AddInternal(object item) + 0x17a bytes
System.Windows.Forms.dll!System.Windows.Forms.ComboBox.ObjectCollection.Add(object item) + 0x1c bytes
BazisLibSetup.exe!BazisLibSetup.SetupWizardForm.DetectDDKLocations() + 0x123 bytes
BazisLibSetup.exe!BazisLibSetup.SetupWizardForm.SetupWizardForm() + 0x39 bytes
BazisLibSetup.exe!BazisLibSetup.Program.Main() + 0x33 bytes
Exception:
System.ArgumentNullException: Value can't be undefined. Parameter name: item
I have WDK installed and registered WDKPATH env. variable.
Let me know if i can provide more details. Library look interesting, want to try it.October 2, 2009 at 11:11 #1128airmaxParticipantReplying to myself.
Author include sources of BazisLibSetup(
supportBazisLibSetup) i dont pay any attention from beginning. Error reproduced if DDK not installed, but WDK installed:
SetupWizardForm.cs
90: if (DDKPath != null) 91: cbDDKPATH.Items.Add(DDKPath); 92: if (WDKPath != null) 93: cbDDKPATH.Items.Add(DDKPath);
To fix error, change line 93 as following
93: cbDDKPATH.Items.Add(WDKPath);
Bazis(sorry, dont know your name), please merge this fix for future.
P.S. Can you setup forum engine to correctly work with Russian symbols, and quotation marks.
October 2, 2009 at 11:16 #1129supportKeymasterOops. Saw the post too late. Already fixed, will be included in next version installer. As for the quotation marks & unicode symbols, maybe will do it later, however, I’m not that good in PHP, as in kernel development 😉
October 2, 2009 at 11:44 #1130airmaxParticipant@bazis wrote:
.. as in kernel development 😉
😆
October 2, 2009 at 11:53 #1131supportKeymaster😮 ??? If something about kernel-mode part of BazisLib is bad, a bugreport/wishlist would be much better than undirected sarcasm.
October 2, 2009 at 12:07 #1132airmaxParticipant😳 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)?October 2, 2009 at 12:25 #1133supportKeymasterSurely you can use the STLPort without BazisLib, however you will need the code that calls static C++ constructors/destructors, that can be easily separated from BazisLib.
As for the compiler flags & etc, I would recommend avoiding exceptions in kernel mode, as using them has quite an impact on performance and stack requirement. Check out the VisualDDK project wizard, it allows creating Visual Studio driver projects without a link to BazisLib.
Finally, regarding object creation & programming style, I could only suggest being sure, what will the optimizing compiler produce from your C++ code, and checking the disassembly in case of a smallest doubt. Anyway, it is possible to make C++ programs as efficient/small as C ones with much less coding effort, however it requires checking the disassembly, as the optimizer is not always perfect.
See WinCDEmu sources for a (relatively) simple example of a C++ kernel driver.October 2, 2009 at 12:44 #1134airmaxParticipantThanks 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?
October 2, 2009 at 12:55 #1135supportKeymasterYou need a special “runtime” libraries to use exceptions. For other purposes (static/global constructors & etc.), the BazisLib startup file is enough.
October 2, 2009 at 13:38 #1136airmaxParticipantThanks for advice.
October 2, 2009 at 13:56 #1137airmaxParticipantBtw, 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?October 2, 2009 at 14:05 #1138supportKeymasterIt is managed by BazisLib. You can see the stlsup.cpp file for new() and delete() implementation. However, note that if you need to allocate objects from non-paged pool, you should use the npagednew() function instead (or, more preferably, overload the new() operator for your specific class, that always needs to be allocated from non-paged pool; for example, see the irpqueue.h file). The standard C malloc()/free() implementations are provided as well for compatibility reasons.
October 2, 2009 at 14:16 #1139airmaxParticipantIt 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");
October 2, 2009 at 14:54 #1142supportKeymasterSo, if i understand correctly, i can use new/delete/npagednew in KM C++ if i include stlsup.cpp?
Yes. Otherwise you will simply get a linker error stating that “operator new()” is undefined.
Just try DDKWizard, why you not use RTL_CONSTANT_STRING to define DeviceName and Win32Device instead of RtlInitUnicodeString?
Sample files for DDKWizard were copy-pasted from some very old stuff without any refactorring. Anyway, thanks for the advice, I’ll probably update the samples.
October 2, 2009 at 14:57 #1140airmaxParticipantAlso, 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.
-
AuthorPosts
- You must be logged in to reply to this topic.