|
Hi All,
Can you please tell me, what all the things i need to take care when i am trying to port my device driver 32 bit to windows 7 64 bit?
|
|
|
|
|
Googling with following phases seems to turn up results.
how to convert from 32bit to 64bit windows 7
gotchas converting from 32bit to 64bit windows 7
tutorial converting from 32bit to 64bit windows 7
converting 32bit to 64bit windows 7 site:codeproject.com
Last of those turned up the following (could be more.)
Lessons on development of 64-bit C/C++ applications[^]
|
|
|
|
|
...except this is a driver, not an app...
|
|
|
|
|
|
Thanks for the reply.
In our case we have a different types of data types used in the app(ie UINT8,UINT16,UINT32) and the different types of pointers(ie PUINT8,PUINT16,PUINT32).Here do i need to change the types to 64 or not?Because i am getting the crashes in the driver driver in different places.
|
|
|
|
|
Yea. You must.
Be careful when performing unsigned and signed operations. Consider the following:
ULONG x;
LONG y;
LONG *pVar1;
LONG *pVar2;
pVar2 = pVar1 + y * (x - 1);
The problem arises because x is unsigned, which makes the entire expression unsigned. This works fine unless y is negative.
In this case, y is converted to an unsigned value, the expression is evaluated using 32-bit precision, scaled, and added to pVar1.
On 64-bit Windows, this 32-bit unsigned negative number becomes a large 64-bit positive number, which gives the wrong result.
To fix this problem, declare x as a signed value or explicitly typecast it to LONG in the expression.
|
|
|
|
|
Thanks for the reply,
in case of pointers for eg PUINT8 OR PUINT16 do i need to change the datatypes to PUINT32 or PUINT64?
and for normal variables UINT8 OR UINT16 do i need to change the datatypes to UINT32 or UINT64?
if not in which cases i have to change the data types.
I am totally new to the drivers programming,Please suggest me some links.
|
|
|
|
|
|
Use size_t types pretty much every where.
|
|
|
|
|
How to check memory usage with in the application by itself?
|
|
|
|
|
On what operating system? If you want to keep track of total memory usage, you'll need a way to determine the size in memory of all code (e.g. application and dynamically linked libraries) and stack, which will vary depending on OS.
For dynamic heap memory usage, you can make your own implementation of new/delete that counts allocated heap memory - this is the approach taken by memory leak detectors. Have a look at VLD which is an open-source memory leak detector for Visual C++.
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
CString csMsg;
PROCESS_MEMORY_COUNTERS_EX procMemInfo = {0};
procMemInfo.cb = sizeof(procMemInfo);
if (GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&procMemInfo, sizeof(procMemInfo)))
{
if (procMemInfo.PagefileUsage==0)
procMemInfo.PagefileUsage = procMemInfo.PrivateUsage;
ULONG ulWorkingSetSize = (ULONG)(procMemInfo.WorkingSetSize / 1024 / 1024);
ULONG ulPagefileUsage = (ULONG)(procMemInfo.PagefileUsage / 1024 / 1024);
CString csProcessMemInfo;
csProcessMemInfo.Format(_T("WorkingSetSize=%lu MBytes, CommitChargeSize=%lu MBytes"), ulWorkingSetSize, ulPagefileUsage);
csMsg += csProcessMemInfo;
}
MEMORYSTATUSEX memStatus = {0};
memStatus.dwLength = sizeof(memStatus);
if (GlobalMemoryStatusEx(&memStatus))
{
ULONG ulUsedVirtual = (ULONG)((memStatus.ullTotalVirtual-memStatus.ullAvailVirtual) / 1024 / 1024);
ULONG ulAvailVirtual = (ULONG)(memStatus.ullAvailVirtual / 1024 / 1024);
CString csMemStatus;
csMemStatus.Format(_T("UsedVirtual=%lu MBytes, AvailableVirtual=%lu MBytes"), ulUsedVirtual, ulAvailVirtual);
csMsg += csMemStatus;
}
|
|
|
|
|
Use the API GetProcessMemoryInfo()
|
|
|
|
|
I have building xll addin for excel by VC in 32bit system as following: http://www.codeproject.com/Articles/5263/Sample-Excel-Function-Add-in-in-C
Now I'm using 64 bit system, I have try to rebuild it in 64bit system: I using 32 bit code, change Platform from 32bit to 64 bit in Configuration Manager
When I build, it is Failed:
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(E:\Programming\interp_src\Debug\Interp32.dll) does not match the Linker
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker
1>.\Release/Generic.obj : fatal error LNK1112: module machine type
1>
1>Build FAILED.
Please help me, how can I build this xll in 64 bit system?
(I using W7-64bit, Excel 2010-64bit and VS2010)
Thank for helping!
|
|
|
|
|
It looks like you may be trying to build a mixture of 32 and 64 bit items. However, since this is connected to a CodeProject article you may get a better answer by using the forum at the end of the article to communicate with the author.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I want to take backup of my server database into my local system.so i have used the following sql query
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory
SET @path = 'C:\Backup\'
-- specify filename format
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name IN ('Sutra') -- exclude these databases
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
FETCH NEXT FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor
i have created the Backup folder in C: drive.but it returns the following error
Msg 3201, Level 16, State 1, Line 28
Cannot open backup device 'C:\Backup\Sutra_20121116.BAK'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 28
BACKUP DATABASE is terminating abnormally.
Please solve it.Thanks in advance
shibashish mohanty
|
|
|
|
|
Does this have something to do with C++?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Hello i believe i have the source code for my program i developed but i am having trouble compiling it. Any help would greatly be appreciated thanks Leon
|
|
|
|
|
|
xLeonx wrote: Hello i believe i have the source code for my program i developed... You're not sure?
xLeonx wrote: ...but i am having trouble compiling it. And that trouble would be what exactly?
xLeonx wrote: Any help...
Such as?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
What IDE or compiler are you using?
At least, what Operating System are you using?
Veni, vidi, vici.
|
|
|
|
|
Thanks for the reply. Sorry about being vague. Well i have windows 7. I have what i think is the source code for a program i had developed by a programmer. Well to make a long story short i had a fire a my plant and all my software burned up. All i have is what i think is the source code but i don't know how to compile it. The program is about a meg in size so i could easily email it. Well thanks again your help is greatly appreciated.
|
|
|
|
|
A tad lean on details.
Steve
|
|
|
|