Inside Windows: Virtual memory, kernel objects, DLLs, and more

On March 7, 2000, Microsoft Press author Jeffrey Richter took you behind the curtain of Windows and showed you how powerful this knowledge could be. Read the transcript.

On March 7, 2000, Microsoft Press author Jeffrey Richter took you behind the curtain of Windows and showed you how powerful this knowledge could be. If you couldn’t join us then, we hope to see you on our next live Guild Meeting.

Note: TechProGuild edits Guild Meeting transcripts for clarity.

About Jeffrey Richter
Moderator: Welcome to tonight's meeting. This week, Microsoft Press author Jeffrey Richter is here to take us deep into Windows for a behind-the-scenes look.

Moderator: Don't forget, we have prizes to give away to the best chatters! Tonight we have a copy of Advanced Windows, 3rd edition, by tonight's speaker, Jeffrey Richter, and a copy of O'Reilly's book Windows 2000 Active Directory.

Mikkilusa: Cool. Let’s rock.

Moderator: Jeff, why don't you say a little something about yourself, then we'll get started.

Jeffrey Richter: Hello everyone.

Erik: Hello.

Jeffrey Richter: So, we're all here to talk about Win32 programming, eh? Something that I've been doing for quite a few years now.

Mikkilusa: hiya.

Abdalla: hello all, this is my first meeting and I am looking forward to it!

Moderator: Welcome, Abdalla—glad to have you aboard!

Jeffrey Richter: I don't know how many of you are familiar with me, but for more info (and possible discussion topics), you can visit my web site: I'm pretty open and informal, so please feel free to ask anything you'd like and I'll do my best to answer it.

Moderator: Sounds great, Jeff. I'll sit back now...let the chatting begin!

Mikkilusa: you will learn lots Abdalla, I do anyway.

Davisey: I have a question, though it may be a silly one.

Jeffrey Richter: Go ahead, Davisey.

Virtual memory settings and paging file explained
Davisey: I have heard that virtual memory settings should be set at twice the amount of physical memory, with a maximum of 128 MB for best performance. Is this true?

Jeffrey Richter: This is not a silly question at all. No, it's not true.

Mobility: Hi. I'm curious about writing DLLs.

Jeffrey Richter: There are many computing scenarios where the paging file is disabled entirely. This is particularly true of embedded NT, which may not have a disk at all. You should set the paging file size to be dependent on whatever applications you tend to run.

Swillits: Please explain the paging file.

Jeffrey Richter: What's the DLL question, Mobility?

Mobility: How do I write them?

Jeffrey Richter: Swillits, the paging file is a file on the disk which is used for virtual memory. If the file is 100MB big, then it's like you have 100MB more RAM, although this "RAM" has slower access than actual RAM. Basically, it allows applications to make memory allocations beyond the physical RAM in the machine.

Jeffrey Richter: DLLs are easy to write. It’s kinda hard in a chat to describe the whole process and their benefits. I have several chapters in my book that address the DLL file. If you have more specific questions, I could answer them better.

Davisey: To continue the previous thought on virtual memory, is it best to allow Windows 95 to manage these settings automatically for a standard use machine, or should they be tweaked for maximum efficiency?

Harold66: i don’t know anything about Win32 programming. If I want to learn, where I should start, what book must I read?

Jeffrey Richter: When using an OS, I would always accept the default virtual memory size and only change it if I knew that it would improve things. For example, if I always work on a very large Excel spreadsheet, and I periodically get out-of-memory errors, then I would increase the paging file size.

Overwriting DLLs
Mobility: Msvcrt40.dll keeps getting replaced by an older version. Can I set it with a 'read only' attribute or something?

Jeffrey Richter: Of course, I'm always going to recommend my book for Win32 programming. But you must realize that Windows is a huge operating system and it is best to find areas to specialize in. I have chosen the kernel and user-interface, and ignore graphics, printing, and so on. The best book really depends on what you decide to specialize in.

Swillits: don't the automatic settings already use the maximum hard disk space available?

Jeffrey Richter: You can try setting the read-only attribute but some applications may still overwrite this. Microsoft realizes that this is a major problem with Windows and is working hard to fix DLL incompatibility in the future.

Mobility: So what should a guy (girl) do about DLLs being overwritten?

Jeffrey Richter: Windows 2000 has a new technology called System File Protection (SFP). SFP ensures that system-related DLLs are not overwritten by bad programs. I'm not sure if the DLL you want is protected, but it may be. And, if it's not protected, you may be able to protect it. I don't know the details of how to do this, however.

Kernel objects explained
Erik: Can you give a brief explanation of kernel objects?

Jeffrey Richter: A kernel object is a resource offered to programmers by the kernel. Windows has several kernel objects: mutexes, semaphores, file mappings, files, and many more. Since the kernel tracks these objects, it knows how they're used and can automatically clean up if an application prematurely terminates.

Mikkilusa: I just got your book today and looked through it briefly. Do I need C++ to do most things in it?

Jeffrey Richter: The latest edition of my book is the first time I decided to use C++ instead of C. It was a hard decision for me to make. Most of the book's text uses C but many of the sample apps now use C++. The apps were easier to implement and maintain this way. TC++ also makes it easy for you to use my code in your own apps.

Solving DLL boot errors
Erik: If you’re having a problem booting into Windows and you’re getting DLL errors, what is the 1st plan of action you would suggest?

Tlsnc: Mobility-upgrade to Win2K. It protects the system32 folder from being overwritten by anything except the OS, or files with a digital signature from Microsoft.

Jeffrey Richter: If you're having trouble booting, I would boot into safe mode—Press F8 when Win2K boots. You can also have it log errors to a file to see which DLL is the problem. From safe mode, you can fix the DLL and boot normally.

Mobility: Thanx Tlsnc.

Erik: What log would that be?

Jeffrey Richter: The log is a text file. I think it's written to the root of the boot drive.

No paging file administration needed
Davisey: One more question on paging files. In Windows NT Server 4.0, does the system administrator need to do anything on a regular basis to be sure that the system utilizes the paging file to maximum efficiency?

Jeffrey Richter: In no version of Windows does an admin have to check the paging file. Only if out-of-memory errors appear should an admin increase the page file size.

Tlsnc: Davisey-get Diskkeeper to defrag regularly. It has an option to also clean the paging file.

Davisey: Thanks for the help on paging files. This is my first Guild Meeting, and I'm delighted with the ease of use, and non-threatening atmosphere for us beginners.

Erik: Tlsnc-Who makes Diskkeeper?

Jeffrey Richter: Diskkeeper is made by Executive Software. There is a stripped-down version that comes free with Win2K.


Jcadmus: what's the difference between the stripped-down version and the full version?

Tlsnc: Executive Software. They have a free "lite" version to try on their Web site. It however does not support the page file option or automatic scheduling.

Jcadmus: tx.

Davisey: Tlsnc—thanks for the tip.

Jeffrey Richter: The full version does a more complete job. It can defragment during the boot cycle so it can move things around that are in-use when the OS is up and running.

PC troubleshooting tools
Erik: I know this is off the subject, but for PC techs, what program is suggested for troubleshooting a PC?

Mikkilusa: Not had a chance to look at the CD that came with book. Tell me about what exciting things await me?

Erik: Hardware and software-wise?

Jeffrey Richter: The CD has a ton of sample apps and some utilities that I wrote. Personally, I use the utilities all the time, they give great insight into what's happening in the system. There are a lot of comments to help explain exactly why everything works the way it does.

Jeffrey Richter: The troubleshooting question is hard to answer. I've spent so much time with Windows that I usually have a good idea of what's going on when something is wrong. There are a ton of utilities out there—many of them free. What I do really depends on what's wrong.

Moderator: Does anyone have a favorite PC troubleshooting utility they can recommend to Erik?

Tlsnc: No utility program, but a good hardware book with videos on CD would be by Mark Minasi.Norton Utilities is good, Erik, and so is Nuts and Bolts.

Should you turn off virtual memory?
Mobility: What happens when virtual memory is turned off?

Jeffrey Richter: When VM is turned off, the system can only use the RAM that's in the computer. This makes all operations fast but greatly limits the number of apps you can run, and the amount of memory that these apps can allocate.

Mobility: Are there useful times to turn off VM? Like when defragmenting?

Tlsnc: Some apps may behave unpredictably. For example, part of CompuServe will load but then you can't get to any user configuration. I have seen this with other programs too.

Jeffrey Richter: No. The only time I'd consider turning off the VM is if my machine had so much RAM in it (maybe half a GB or more), and I was sure that this was all I ever needed.

Mikkilusa: To add for those who might have a need to copy files to a network, turn off VM or you will crash out.

Tlsnc: Mobility-yes. when suspecting a corrupt swap file, reboot, re-enable, and reboot again. Also, if copying a Windows directory to another directory or drive.

Moderator: There's about 20 minutes left to ask Jeff all of your Advanced Windows questions.

Tlsnc: I would not run without VM. I only turn it off for troubleshooting OS.

Avoid upgrades
Erik: Hey, Jeff, what's your opinion on upgrading from Windows9x to Windows2K? I mean for workstations on a network?

Jeffrey Richter: Personally, I NEVER do upgrades—period. Microsoft changes a lot of things with each version of the system and sometimes new features get disabled if you're doing an upgrade. I ALWAYS re-format my drive and do fresh installs. It's also a good discipline to get into because I always have my personal files backed up.

Disabling F3 (find) in Win95
Mhale5: I work in a school where we would like to disable the F3 (find hot key). We see that it was added to the policy editor for Win98. How can I disable it in Win95?

Jeffrey Richter: If Win95 doesn't support that policy then I don't know of anything in the system that will allow you to disable F3. You could write a program to trap and ignore the F3 key.

Which drive for the swap file?
Mobility: Is it wise to put the swap file on the slave drive in a two drive system?

Jeffrey Richter: Generally, you want the swap file on the fastest drive since it's accessed frequently. If both drives are the same speed, then you can split the paging file between multiple drives (Windows NT/Windows 2000 only). This allows the system to access both drives simultaneously and performance is greatly improved.

Win2K and Novell 5
Jcadmus: Are there any known problems with Win2K and Novell 5?

Jeffrey Richter: I'm not aware of any Win2K and Novell problems.

Moderator: 10 minutes left... keep asking those great questions!

Computer hangs during shutdown
Swillits: What suggestions would you give to find out why the computer hangs during shutdown.

Mikkilusa: Unplug it?

Jeffrey Richter: I would first disable power-management features. Then, I'd try booting in safe-mode and shutting down. If the problem goes away then it must be something that runs outside of safe-mode. You could try disabling services.

Mobility: What can I set "vcache" settings to in system.ini to prevent vfat errors? My system has 256MB of RAM.

Jeffrey Richter: I don't know enough about vcache—I'm mostly an NT/W2K guy.

Moderator: 5 minute warning folks—in a few minutes I'll announce tonight's winners.

Mikkilusa: So do all things in your book apply to Win2K, too?

Jeffrey Richter: The 4th edition of my book is for Win95/98/NT4/2K.

Lost key code
Mobility: Thanx Vjeffrr. I lost my key code to NT 4. Is there a way to find it?

Jeffrey Richter: I don't know about key-codes.

Mobility: How can I install NT off of CD without the OEM number.

Tlsnc: You can use all 1s as the key code.

Swillits: how do Windows 98 and the autoexec.bat and config sys files work together?

Mobility: Thanks Tlsnc!!

Tlsnc: Enjoy it now, because you won't be able to do it with Win2K!

DLL history
Erik: Is there somewhere you can look to see a history of DLLs to see what programs used it, and how many times it's been updated?

Jeffrey Richter: No, there is no DLL history like you mention.

Mikkilusa: I did see a program in Locker GNOME other day that shows what programs link to what DLLs.

Jeffrey Richter: There is no history, but Microsoft has a tool called Depends that shows what DLLs an app needs.

Mikkilusa: hehehehe like the diapers how ironic.

Moderator: Great questions tonight, everyone! It's time to wrap things up for the evening...

Erik: Thanks Jeff.

Mhale5: Thank you.

Moderator: Before I announce the winners, I'd like to send a big thank you to Jeff Richter for speaking tonight!

Swillits: Thank you, Jeff.

Jeffrey Richter: My pleasure everyone.

Jcadmus: Thank you, Jeff.

Tonight’s winners
Moderator: And tonight's winners are...(drumroll, please)...

Moderator: Mobility, you win the copy of Jeff Richter's book Advanced Windows. Tlsnc—you've won the copy of O'Reilly's Windows 2000 Active Directory.

Mobility: COOL.

Moderator: And Erik, a TechRepublic shirt is coming your way!

Moderator: Winners, please send your snail mail address and phone number to

Tlsnc: Allright!!!

Mikkilusa: Congrats Mobility and Tlsnc and Erik.

Moderator: Everyone, if you have specific questions, remember to visit our forums. Thanks to everyone for coming. Don't forget to tune in Thursday for a chat about making NT4 coexist peacefully (and compatibly) with other OSs and applications.

Mikkilusa: nite all. Thursday, same place same time same bat channel.

Jpnerd: Thank you all. It was my first meeting.

Moderator: Thanks for stopping by Jpnerd.

Awasa: It was my first one, too. I will try to participate in the future. Thanks.
Our Guild Meetings feature top-flight professionals leading discussions on interesting and valuable IT issues. You can find a schedule of Guild Meetings in your weekly TechProGuild Notes TechMail, or on the Guild Meeting calendar.

Editor's Picks