|
Thanks, but that actually wouldn't have helped. The point was I didn't know where the host app was calling in. So, short of adding in a call like that to every method, as well as every method of every base class, there was no solution that I could program in.
Breaking on MyDLL.dll!* is pretty much the only solution. Even the Class::* didn't work, as the parser failed to find some of the templatized based classes. Again, manually going through each and every base and adding breakpoints in would have caught them for each class that I tediously added them all in, but I was really hoping to get a better idea of when anything was called by the host app.
|
|
|
|
|
Hi
I have created BHO add ons for internet explorer. When I debug this add ons on vista IE7 then it debug correctly, but when I debug this on IE9 on windows vista , it can not be debug and no break point get invoked. So is there any setting required for this.
I also observed that BHO add ons can debug only on default browser come with windows OS. i.e win XP IE6, vista IE7 and windows 7 IE8, if user upgrade browser then BHO can not debug.
Please send me setting required for debuging.
|
|
|
|
|
Set HKCU/Software/Microsoft/Internet Explorer/Main/TabProcGrowth to 0 and check if you can debug correctly.
|
|
|
|
|
Thanks Rejeesh !!
|
|
|
|
|
I call DeviceIoControl() as below:
err = DeviceIoControl(hVolume,IOCTL_SCSI_PASS_THROUGH_DIRECT,(PVOID)sptd_sb, (DWORD)sizeof(sptd_sb),(PVOID)sptd_sb,(DWORD)sizeof(sptd_sb),dwBytesReturned,NULL);
which sptd_sb is a _SCSI_PASS_THROUGH_DIRECT_AND_SENSE_BUFFER.
in most of the DVD Rom and CD Rom it works well and it fills in sptd_sb but in some of them like ASUS CD s400/A ATA Device it doesn't and sptd_sb is empty while the return value is 1 and GetLastError is 0 in both situation.
does anybody have anyidea about it?
thanks in advance
|
|
|
|
|
Hey everybody!
Is there a way to get access rights out of a process HANDLE ?
Thanks!
|
|
|
|
|
|
Hey,
Thanks for your answer, but I can't see how it returns the Access rights of the process HANDLE (not the token's access rights).
|
|
|
|
|
CAccessToken::GetProcessToken will get the token belonging to the process handle.
You can do the same using the OpenProcessToken API.
|
|
|
|
|
Hey,
I know about Access tokens, but it is not what I want.
I want to know if the given HANDLE of process has a certain access rights. For instance, SYNCHRONIZE or PROCESS_TERMINATE.
Is it possible to do so with Access Token?
|
|
|
|
|
you may open another handle to that process using process id. Specify desired access right such as SYNCHRONIZE or PROCESS_TERMINATE in OpenProcess(). Check the return value to test whether desired right on process is granted or not
i don't know whether there is any undocumented API for enumerating process access rights
|
|
|
|
|
Yeah, that's what I thought as well...
So I guess I'll have to check the kernel mode function, and check if it is also implemented in ntdll.dll (like other functions I found).
Thanks a lot anyway!
|
|
|
|
|
Hey everybody.
I wrote (according to articles I found on the net) the following code, in order to get the command line of another process (it is not the "full code", just until it fails.
HANDLE hproc = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if(!hproc)
{
printf("OpenProcess() failed: 0x%x", ::GetLastError());
return _T("");
}
_NtQueryInformationProcess NtQueryInformationProcess = (_NtQueryInformationProcess)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQueryInformationProcess");
PROCESS_BASIC_INFORMATION pbi;
DWORD size_written;
NTSTATUS nt = NtQueryInformationProcess(hproc, ProcessBasicInformation, (void*)&pbi, sizeof(PROCESS_BASIC_INFORMATION), &size_written);
if(nt)
{
printf("NtQueryInformationProcess() failed: 0x%x", nt);
return _T("");
}
PEB* peb = pbi.PebBaseAddress;
ULONG session_id = peb->SessionId;
SIZE_T read_size;
RTL_USER_PROCESS_PARAMETERS* proc_params = NULL;
DWORD old_protection;
if(!::VirtualProtectEx(hproc, peb->ProcessParameters, sizeof(RTL_USER_PROCESS_PARAMETERS*), PAGE_EXECUTE_READWRITE, &old_protection))
{
printf("VirtualProtectEx() failed: 0x%x", ::GetLastError());
return _T("");
}
if(!::ReadProcessMemory(hproc, peb->ProcessParameters, (RTL_USER_PROCESS_PARAMETERS*)proc_params, sizeof(RTL_USER_PROCESS_PARAMETERS*), &read_size))
{
printf("ReadProcessMemory() failed: 0x%x", ::GetLastError());
return _T("");
}
if(!::VirtualProtectEx(hproc, peb->ProcessParameters, sizeof(RTL_USER_PROCESS_PARAMETERS*), old_protection, NULL))
{
printf("VirtualProtectEx() failed: 0x%x", ::GetLastError());
return _T("");
}
The output is that ReadProcessMemory() fails with ERROR_PARTIAL_COPY.
The code works in XP for processes in the same session.
Currently I am trying to make it work in windows 7, for a process in the same session.
ANY IDEAS any one ????
Thanks!
|
|
|
|
|
Are you running the application with elevated privileges (Run as administrator)?
|
|
|
|
|
Yes.
|
|
|
|
|
I am testing a legacy app for use on Windows 7, both 32 and 64 bit. It presently runs on XP. For some unknown reason OLE database accesses take orders of magnitude time longer to run on Windows 7 than on XP. For this testing XP is running in a VM on the same Windows 7 64 bit machine used for Windows 7 testing, so the hardware is not the issue.
For example the following code takes 2276 ticks on Windows 7, 80 ticks on Windows XP.
startTime = GetTickCount();
CDBConnection DB;
if( DB.Open( m_DBConnectSettings ) )
{
DB.Close();
endTime = GetTickCount();
logStr.Format(_T("CDBEngine::InitializeDatabase DB.Open elapsedTime: %d ticks"), (endTime - startTime));
EventLog.LogEvent(0x04, logStr);
}
BOOL CDBConnection::Open( const CDBConnectSettings &Settings )
{
USES_CONVERSION;
return( SUCCEEDED( OpenFromInitializationString(
T2COLE((LPCTSTR)Settings) ) ) );
}
I am using:
Development Studio 2003, version 7.1.6030
Microsoft .NET 1.1 Version 1.1.4322 SP1
MSDE 2000 (SQLServer Express derives from this).
The following system dlls:
DLL
Unless otherwise noted, the DLL versions are:
Windows 7 is Product version: 6.1.7600.16385
Windows XP is Product version: 5.1.2600.5755
ADVAPI32.DLL
COMCTL32.DLL WinXP = Product version: 6.00.2900.5512
COMDLG32.DLL
GDI32.DLL WinXP = Product version: 5.1.2600.5698
MAPI32.DLL WinXP = Product version: 5.1.2600.0
MFC42.DLL Win 7 = Product version: 6.06.400, Win XP = Product version: 6.02.400
MSVCRT.DLL Win 7 = Product version: 7.0.7600.16385, WinXP = Product version: 7.0.2600.5512
OLE32.DLL WinXP = Product version: 5.1.2600.5512
OLEAUT32.DLL Win 7 = Product version: 6.1.7600.16567, WinXP = Product version: 5.1.2600.5512
RPCRT4.DLL WinXP = Product version: 5.1.2600.5795
SHELL32.DLL WinXP = Product version: 6.00.2900.6018
SHLWAPI.DLL WinXP = Product version: 6.00.2900.5912
USER32.DLL WinXP = Product version: 5.1.2600.5512
WINMM.DLL
Thanks for any thoughts, suggestions, ideas, answers, etc.
Clarence
|
|
|
|
|
Hello !
I want to develop this tool :
Customer can use the toolbar to draw his button , rectangle more and more.
the window can be move or draged ,like edit in the Visual C++ resource view.
(He can insert a new window, like Visual C++ "Insert a dialog".)
At last ,this will save as a script file.
Which knowledge is it to be need ?
|
|
|
|
|
Koma Wang wrote: Which knowledge is it to be need ?
Quite a lot. You need to be able to write a program with a GUI front end that can show menus, dialogs, bitmaps, icons, strings, version resources (and others I may have forgotten) in their natural state. The user will then want to add and remove pieces from them, move objects around, save and reload the resource, etc, etc. Assuming you are a highly skilled developer this should be less than a couple of years' work.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Assuming you are a highly skilled developer this should be less than a couple of years' work.
|
|
|
|
|
Oh , my god !
I just less than half a year's work experience.....
Now I use the GDI to draw a static text shape, but I don't know how to handle the shape move message.
I want to clearn the old shape, then draw a new static text shape.but the dialog can't catch the window move message when mouse's position is in the client area.
(the dialog only can be dragged ,because the mouse postion is in the title bar.)
|
|
|
|
|
don't worry.. he was just telling how much effort it requires.
|
|
|
|
|
thanks all the same.
|
|
|
|
|
I use the visual studio 2005 to compile the mfc c++ program. But it shows that can not find mfc dll when run the program
I find that I have not installed the sp1 for the visual studio 2005.
But I install sp1 several times fails. It says the error 2349.
Is there any other package that must be installed before sp1?
Can anyone help me?
thanks.
modified on Wednesday, September 15, 2010 9:11 PM
|
|
|
|
|
try to reinstall vs2005, then install the sp1.
|
|
|
|
|
After install the Service Package 1, it's OK.
But it is difficult to install the service package 1 for vs 2005.
The errors often occur.
|
|
|
|
|