|
Hi,
I'm looking for a way to find the remote ip and port of a UDP packet being sent to a specific process (not my program).
I've looked at using the GetExtendedUdpTable() function on MSDN, but it will only return the local address of the UDP packet, which is useless given that i could work out the local IP easily.
I've also started to look at writing a TDI driver which would be able to return the remote IP address (at least i think it can) but i haven't seen any obvious way to connect this with a process ID. The TDI device driver tutorial here was useful, but it only seemed to show that you could use TDI instead of standard sockets. I've also read the stuff here on GetExtendedUdpTable (even if it was for c#) but as the function is limited as i mentioned before.
I know it is possible though, as a program called "TDImon" by sysinternals does it. Its closed source of course, so it doesn't really help me. It does give some clue of how it works in the help file, but i'm having enough trouble with the idea of developing a device driver, let alone making a connection between TDI and Winsock.
Quote:
TDImon gets its name from the fact that it monitors activity at the Transport Driver Interface (TDI) level of networking operations in the operating system kernel. This is the interface to protocol stacks such as TCP and UDP. Thus, the I/O activity shown by TDImon corresponds to TDI-formatted commands. Most TDI commands have direct correspondence with WinSock (the Windows socket API) functions, and thus are easy to interpret. For documentation on TDI and the commands shown in TDImon, please see the Windows NT or Windows 2000 DDK, available for free download from Microsoft’s web site.
So,
is there an easier way to do this?
Can someone please give me some pointers as where to look into TDI thats free and not the MS DDK?
Sample TDI code would be appreciated if someone has anything that will do something like what i'm looking for.
Thanks in advance
three_pineapples
p.s. In case it matters i'm developing on Windows XP SP2 using the Mingw C++ Compiler (which doesn't appear to have the GetExtendedUdpTable function, probably because the function is native to XP SP2 only).
|
|
|
|
|
Hi,
Iam using vc++ 2005 express edition ,whenever i compile my project it shows me the link error as
LNK1181:Cannot find input file ODBC32.lib
I downloaded ths from microsoft and also SDK.as per the instructions i chnaged everything?why its coming like this.
I need only Win32 Console application.
Pls help me out?
Anu
|
|
|
|
|
Is it available for linker?
|
|
|
|
|
Hi
i have written cose in vc++.now i want to integrate this code in c#.
plaese tell me the process to do so.
parshant
|
|
|
|
|
Hi all,
I am using EVC++ for developeing application on PocketPC.
I have make propertypage & initialize scroll bar in that.
But my OnInitDialog() method is not executed at all so my scrollbar is not initialize.
I have also take some reference project of this site.
regards,
Divyang Mithaiwala
|
|
|
|
|
I am trying to overload an assignment operator that that assigns an underlying type with the the assignment operator of the template's underlying class. It should be much simpler than creating the syntax of my opening sentence.
If anyone can tell me what the hell im doing wrong I would be much obliged.
template <typename T> T& operator=(T& t,const Object<T>& object);
template <typename T> class Object{
friend T& operator=(T& t,const Object<T>& object);
public:
Object();
//ommitted for brevity
protected:
Object<T>* m_daddy;
T m_data;
};
//----------------------------------FOLLOWING IS THE CPP FILE
#include "StdAfx.h"
#include ".\table.h"
template <typename T> T& operator=(T& t,const Object<T>& object){
t = object.m_data;
return t;
}
template <typename T> Object<T>::Object(){
//the constructor stuff goes here
}
I GET THE FOLLOWING ERROR
c:\Visual Studio Projects\Statistician Pro\Table.h(5): error C2801: 'operator =' must be a non-static member
|
|
|
|
|
Read your error message. operator= must be a member of the class, in this case Object .
|
|
|
|
|
Some applications use a control that combines a tree view with a list view. You can expand the nodes of the tree, and then underneath each node, you can have list items.
How is that implemented? Is there a commercial control that someone can recommend? Is it something I might be able to code myself?
Thanks,
Rich
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I have never seen such a thing, I don't suppose you could give me an example exe name with a control like you describe. If you have the control in front of you, why not just use spy++ to see what type of control is being used.
|
|
|
|
|
waldermort wrote: If you have the control in front of you, why not just use spy++ to see what type of control is being used
Thank you, that is a good idea. An example of such a control can be found in the SysInternals Autoruns.exe utility. It seems to display headings as tree nodes, but details as list view items.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
The treelist is not a built-in control, however there are several articles here at CP that have code for such a control
|
|
|
|
|
Thanks for letting me know the name of the control: TreeList
Now I know what to look for!!
Y.T.
Rich
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I used the following code to get file date time stamp.
CFileFind ff;
CFileStatus status;
xxxxxx;
xxxxxx;
CString strFilePath = ff.GetFilePath();
CFile::GetStatus(strFilePath, status);
CTime Ftime = status.m_mtime;
Ftime is CTime object. But CTime has limit (Year <=2037 or so)
is there another ways to get file date time stamp except CFile::GetStatus?
Thanks
|
|
|
|
|
Have you checked out the Win32 API GetFileTime ?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Thanks. I used GetFileTime. But I got another problem.Following is my code:
TCHAR FilePath[MAX_PATH];
TCHAR NewPath[MAX_PATH];
WIN32_FIND_DATA fd;
FILETIME mtime, local;
SYSTEMTIME st;
sprintf(FilePath, "%s\\*.*", strpath);
HANDLE hFind = FindFirstFile(FilePath, &fd);
if (hFind == INVALID_HANDLE_VALUE)
return;
do
{
if (fd.cFileName[0] != '.')
{
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
sprintf(NewPath, "%s\\%s", strpath, fd.cFileName);
Findfiles(NewPath);
}
else
{
GetFileTime(hFind, NULL, NULL, &mtime);
FileTimeToLocalFileTime( &mtime, &local );
FileTimeToSystemTime(&local, &st);
CString time;
time.Format("%02d/%02d/%04d", st.wMonth, st.wDay, st.wYear);
AfxMessageBox(time);
}
}
}
while (FindNextFile(hFind, &fd));
FindClose(hFind);
But my file last modofied time is 9/5/2006. The Time always dispalyed as 12/24/18186. what is wrong?
Thanks a lot.
|
|
|
|
|
The members of the SYSTEMTIME structure are of type WORD . You need to change your format to
time.Format("%02hd/%02hd/%04hd", st.wMonth, st.wDay, st.wYear);
Software Zen: delete this;
|
|
|
|
|
I am upgrading a VS 2003 project to VS2005 that contains managed and unmanaged code. According to MS documentation and testing I can no longer build a release that statically links to the Runtime libraries. I have to use dynamic linking instead. That is OK, Im flexible. But how do I find which libraires I need to include in my installation for deployment and where on the target system do I install them? If anyne can point me in the right direction, I would appreciate it.
Craig
|
|
|
|
|
|
Thanks Jun for the suggestion. I already have the 2.0 framework installed on my test system. Still, it doesn't work. When I try to run the application I get a message "This application failed to start because the application configuration is incorrect". It does look as if the needed dll's are in the Global Assembly Cache, so maybe something else is up. I'll keep trying. Thanks again.
Craig
|
|
|
|
|
Solved the problem. The answer is to install the VC redistributable files from following link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
Craig
|
|
|
|
|
an alternative to using the MS installer for the VC runtime libs is to look in your VC install directory for the redist directory. Under there, you'll find the redistributable libraries. You can just include them all in your install dir.
the nice thing about this approach is that you can have an installer which just copies files over and which doesn't risk requiring admin privs which users don't always have.
Either way will work, but I've found the straight copying approach, using the stuff under redist works very well.
Granted, if you're using .NET you are stuck having to run that separate installer or just having that as a requirement, but this at least takes care of the MFC/runtime lib stuff.
|
|
|
|
|
I have a project that was a MFC ccmdtarget app in vs 6 we are moving it to vs 2005 but I get link errors.
utoEngine.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass const CCmdTarget::classCCmdTarget" (?classCCmdTarget@CCmdTarget@@2UCRuntimeClass@@B) referenced in function "protected: static struct CRuntimeClass * __stdcall AutoEngine::_GetBaseClass(void)" (?_GetBaseClass@AutoEngine@@KGPAUCRuntimeClass@@XZ)
AutoEngine.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass * __stdcall AutoEngine::GetThisClass(void)" (?GetThisClass@AutoEngine@@SGPAUCRuntimeClass@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static class COleObjectFactory AutoEngine::factory''(void)" (??__E?factory@AutoEngine@@2VCOleObjectFactory@@A@@YAXXZ)
I know this has somthing to do with the way I am linking to MFC, but I have tried to ensure that I am only linking to the mfc 8.0 library only.
a programmer traped in a thugs body
|
|
|
|
|
Just a litlle more info AutoEngine is my class. Also I have both VS 6 and .net on my comp. I have assured that all projects that we are dependant with link to the right mfc library.
a programmer traped in a thugs body
|
|
|
|
|
originally i had:
UCHAR *buff1 = 0, *buff2 = 0,*buff3 = 0;
buff1 = new UCHAR[45000000];
and I used it:
ReadFile(...,...,buff1+offset,...,NULL);
and that was fine.
then I changed it so that it's more flexible:
UCHAR *buff[3];
buff[0] = new UCHAR[45000000];
buff[1] = new UCHAR[45000000];
buff[2] = new UCHAR[45000000];
when I do:
ReadFile(...,...,buff[num],...,NULL);
buff[num]+= 2028;//increment the pointer to the next chunk
I get the error code "998" which is "Invalid access to memory location."
could someone please explain to me what I'm doing wrong?
thanks!
Kitty5
|
|
|
|
|
kitty5 wrote: ReadFile(...,...,buff1+offset,...,NULL);
You are reading into an invalid memory location. You must allocate memory for buff1 , or assign it to a valid memory location, before it can be used in this fashion.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|