 |
|
 |
Hello Code Group members,
I want to debug the kernal mode driver in windows 98. I have the debugger given by the Microsoft with the 98ddk "wdeb98.exe". I using the rterm98 for displaying the messging by the serial port. But I am not entering in the source level debugging. Eventhough in the FAQ of Rterm98 it is given that
"Go into the code search path and type in a path to your components source code. Break in and you should see you source appear on the right in a pop-up window. If you do not, type in LN and make sure your component's symbol file has line number information.
"
I did in the same way but source code window is not coming.
Please give me the Idea.
Thanks
|
|
|
|
 |
|
 |
Just curious why you are dividing by 1.0e+9 rather than 1024^3?
|
|
|
|
 |
|
 |
it means a bug
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
>The author has wrapped it into a C++ class. I do not see why you think it's a copy.
May be I am wrong...
It is just:
1) Total work involved: about 3 min tops?
2) Wraps single API.
3) Windows has 30k APIs?
4) CP is pretty difficult to search as it is. Don't trash it with basics.
Brian
|
|
|
|
 |
|
|
 |
|
 |
Mike Dunn some time ago gave me this snippet - If you download the latest Platform SDK and then add the following
In stdafx.h
#define COMPILE_NEWAPIS_STUBS
#define WANT_GETDISKFREESPACEEX_WRAPPER then in the file where you use GetDiskFreeSpaceEx....#include <newapis.h> GetDiskFreeSpaceEx will then work on Windows95 OSR1 aswell.
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |
|
 |
Only Win95 OSR2 and upwards support GetDiskFreeSpaceEx. Look at the latest MSDN entry for GetDiskFreeSpaceEx to find how to swap between GetDiskFreeSpaceEx and just GetDiskFreeSpace.
Thanks for a good implementation anyway. If it supported all Win95s it would be perfect for me. If I get time I may modify your code myself.
Cheers
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |
|
 |
Since the original 95 doesn't include and can't even access FAT32 partitions to begin with, then obviously GetDiskFreeSpace() is all you need on that OS...right?
Isn't this like worrying that your app running on 95 can't determine the amount of free disk space on an NTFS partition on a dual-boot system?
|
|
|
|
 |
|
 |
I'm not 100% sure what you mean. The command GetDiskFreeSpaceEx is not present in Win95 OSR1, so apps using GetDiskFreeSpaceEx will not work on Win95 OSR1.
If you want to use an app on any OS from Win95 that can tell the free space the easiest way is to use the new #defines and use the GetDiskFreeSpaceEx command. Otheriwse when run on Win95 OSR1 an error will occur. Another way would be to interrogate kernel32.dll and find the GetDiskFreeSpaceEx function and use it, otherwise use the GetDiskFreeSpace command.
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |
|
 |
Right--if you call GetDiskFreeSpaceEx() directly, the app won't run at all on the original 95. *Any* time you can *any* API that might not exist on a previous OS, you should call LoadLibrary() to load the DLL and GetProcAddress() and all that crap. That's a given.
What I was saying is that if you're on the original 95, you won't *have* a partition that's larger than 2GB to begin with, therefore GetDiskFreeSpace() is all you need...
|
|
|
|
 |
|
 |
Daniel Desormeaux wrote:
What I was saying is that if you're on the original 95, you won't *have* a partition that's larger than 2GB to begin with, therefore GetDiskFreeSpace() is all you need...
True, but that's only if I want it to run on Win95 OSR1. I just happen to be writing my own custom installation wizard, that needs to run on any OS from Win95 OSR1 to WinXP so I use the #defines (in the thread above) and GetDiskFreeSpaceEx. The #defines just do all the LoadLibrary stuff for me, and I can forget about it.
Anyway who writes apps for Win95 OSR1 only now?
[Edit]Having said that I do still have to support some DOS apps.... [/Edit]
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |
|
 |
I've always just used:
BOOL GetFreeDiscSpace(LPCSTR lpszPath, DWORDLONG* pnFree)
{
typedef BOOL (CALLBACK GETFREESPACE) (LPCTSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
BOOL bRet = FALSE;
HINSTANCE hInstance = LoadLibrary("KERNEL32.DLL");
if (hInstance) {
GETFREESPACE *lpfnDLLProc = NULL;
lpfnDLLProc = (GETFREESPACE*)GetProcAddress(hInstance, "GetDiskFreeSpaceExA");
if (lpfnDLLProc) {
ULARGE_INTEGER nTotalBytes, nTotalFreeBytes, nTotalAvailable;
if ((*lpfnDLLProc)(lpszPath, &nTotalAvailable, &nTotalBytes, &nTotalFreeBytes))
{
*pnFree = nTotalFreeBytes.QuadPart;
bRet = TRUE;
}
}
FreeLibrary(hInstance);
}
if (!bRet)
{
ULONG dwSectorsPerCluster;
ULONG dwBytesPerSector;
ULONG dwNumberOfFreeClusters;
ULONG dwTotalNumberOfClusters;
if (GetDiskFreeSpace(lpszPath, &dwSectorsPerCluster, &dwBytesPerSector,
&dwNumberOfFreeClusters, &dwTotalNumberOfClusters))
{
*pnFree = dwSectorsPerCluster * dwBytesPerSector * dwNumberOfFreeClusters;
bRet = TRUE;
}
}
return bRet;
}
Rail
|
|
|
|
 |
|
 |
I used something similar, until Mike Dunn pointed me to the latest Platform SDK
Just
#define COMPILE_NEWAPIS_STUBS
#define WANT_GETDISKFREESPACEEX_WRAPPER
then in the file where you use GetDiskFreeSpaceEx....
#include
Just a bit shorter.....
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |
|
 |
> so I use the #defines (in the thread above) and GetDiskFreeSpaceEx
...but using #defines would select the appropriate call at compilation time, not runtime (I haven't looked at how the code was structured yet )...
I'd call GetDiskFreeSpaceEx() first (through LoadLibrary(), GetProcAddress(), etc), then if that fails revert back to GetDiskFreespace()...thus no need to explicitely identify the OS beforehand.
> Anyway who writes apps for Win95 OSR1 only now?
I wish I could make the claim that I don't. Unfortunately with the nature of the code I'm writing I can't ask for any client machine to have any update of any kind--browser, OS, patch...the thing I always have to keep in sight is that whatever I come up with it's gotta run on 95 and NT4 onwards.
Until about 3 years ago I still had to maintain Win16, OS/2 and DOS ports of an app (on top of Win32). So dropping support for "everything but Win32" was a big step forward...
|
|
|
|
 |
|
 |
Daniel Desormeaux wrote:
...but using #defines would select the appropriate call at compilation time, not runtime (I haven't looked at how the code was structured yet )...
The #defines selects a replacement function for GetDiskFreeSpaceEx that does all the LoadLibrary stuff that we've talked about. Download the latest SDK and search for one of the #defines and you'll see the function.
Daniel Desormeaux wrote:
> Anyway who writes apps for Win95 OSR1 only now?
I wish I could make the claim that I don't.
I still do I'm afraid! I even have to support some the old DOS versions as some of our customers refuse to go over to Windows as they maintain the data entry is faster in DOS!
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
 |