|
Thanks for your reply. As I indicated, I do not own the program and therefore do not have the source. The vendor no longer seems to be in business.
Anyway, I found a regerstry setting.
thanks
|
|
|
|
|
If the application has crashed, what would be left to cancel?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
The system presents the admin with a doctor watson msgbox.
I got my answer, thanks
|
|
|
|
|
I have written a DLL which hooks different application on their thread
id.
Once the events are trapped in the dll , then the functions are
written separately to process the hooking in the dll.
But through out the dll , I have defined a static counter variable.
This is supposed to get modified in each of the trapping functions.
But it seems that the variable is not getting modified .
I need to pass the modified value to some other application using a
third function in the dll.
What should I do to ensure that the common variable is updatable from
all the Hook-processing functions
Thanks in anticipation
Rajesh
|
|
|
|
|
Place your static in a data segment like this.
#pragma data_seg (".StaticShare")
static unsigned int counter = 0;
#pragma data_seg ()
This assure that this variable will be available for all instance of your dll. You will have multi copy of your dll but only one data_seg (StaticShare).
P.S. you can name your data_seg the name you want.
Bye.
|
|
|
|
|
|
Hi, i wonder if anybody with knowledge of the TCP header can help me with this one:
I am casting some data from a buffer provided by the winpcap packet capture library into a struct I have defined to represent the TCP header, the header is at the start of the buffer and I am casting it like this:
<br />
tcpHeader = (tcp_header *) (UCHAR*) tempDatagram.pkt_data;
where the tcpHeader is of type:
<br />
typedef struct tcp_header{<br />
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
UINT x2:4;
UINT off:4;
UCHAR flags;
USHORT win;
USHORT crc;
USHORT urp;
} tcp_header;<br />
the cast is working upto the offset i think and then values are being filled in a little randomly from there so I dont think i have the tcp_header defined right for the TCP header, can anybody suggest how to fix it?
|
|
|
|
|
|
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
So far, so good. The next bit, according to "Internet Protocols Handbook," should be:
Data Offset - 4 bits
Reserved - 6 bits
Flags - 6 bits
I think I'd take the whole lot and make one 16-bit value of it, using ORs to set the flags and offset bitfields. Also, this reference indicates that a variable length Options field, padded by 0s in the low-order bits to 32-bits, is expected to precede the data block. The book doesn't mention whether the Options field is required; the RFC (793) may be more specific.
I've felt much better since I gave up hope.
|
|
|
|
|
Cheers for the reply roger,
Can you give me a hint at which data types would be best suited for these fields and how to declare them at that length in c++, considering that I would rather they were kept seperate from one another so no further processing is required to split the header data into component parts.
As you can tell I am a bit of a novice at c++ and the MFC's and i think i have bitten off a bit more than I can chew
|
|
|
|
|
packetlos wrote:
i think i have bitten off a bit more than I can chew
I think you're right, but I don't know any better way to learn and grow than to take on and accomplish a task that is beyond one's current capabilities.
As for data types, there really isn't anything in C++ that I know of that handles 6-bit fields efficiently, but I rather like 32-bit words, manipulated with logical bitwise operators for what are essentially flag fields. This approach lets you define in advance several constants that you can simply OR into the word, and allows you to isolate parts of interest with an AND. I'd make the whole Offset:Reserved:Flags:Window section a single word, That should also eliminate any need for worrying about memory alignment in your struct.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Could I not do something like this:
typedef struct len_flags
{ USHORT unused : 6,
len: 4,
flags : 6;
} len_flags;
typedef struct tcp_header {
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
len_flags lenflags;
USHORT win;
USHORT crc;
USHORT urp;
} tcp_header;
Then test the flags like this:
if (tcpHeader->lenflags.flags & TH_URG)
tempTCP.flags = "URG ";
if (tcpHeader->lenflags.flags & TH_ACK)
tempTCP.flags += "ACK ";
if (tcpHeader->lenflags.flags & TH_PUSH)
tempTCP.flags += "PSH ";
if (tcpHeader->lenflags.flags & TH_RST)
tempTCP.flags += "RST ";
if (tcpHeader->lenflags.flags & TH_SYN)
tempTCP.flags += "SYN ";
if (tcpHeader->lenflags.flags & TH_FIN)
tempTCP.flags += "FIN ";
But it dosent seem to work , something to do with #pragma pack?
Regards
Packetlos
|
|
|
|
|
Hi
I know this is a C++ forum but i think this is a very common question.
I am creating a client server application in VB.net. client is calling a method in the server using a proxy class. I am throwing an exception on the server side. Now i want the client to capture that particular exception. How can i do that. I could able to achive this when i run both client and server on the same machine but when i run the client on the different machine I am getting an exception server generated and exception check the server's config. file. How can i catch the particular exception generated by server.
thank you
|
|
|
|
|
how can i make a SDI application into full screen, in a way that application occupies entire screen(no taskbar )and no Minimizing/moving for the window..
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
Consider making it a dialog based app and removing the dialog's caption bar at design time. Then, in the dialog's OnInitDialog() handler call SetWindowPos() to maximize the window and keep it on top of all other windows.
PS: This won't cover the taskbar.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hey Ravi, Thats not a dialog based app..
that s a SDI app.
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
you can do the similar thing for the sdi application too.. in the onCreate event remove the caption style before the frame is created.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
ok lemme try
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
I have implemented 2 threads simulating the counting semaphore. One thread sleeps for 20 milliseconds as in Sleep(20);
The other thread writes the time into a file. When i observe the file, in my System it prints for 50 times/second, which should be the case (20 milliseconds * 50 = 1000 milliseconds = 1second).
In other computers, it writes only 32 times / second in the file.
What could be the problem.?
|
|
|
|
|
that might be beacause windows is not a real-time kernel. so, if an application is running in kernel mode, even if your interrupt signal must call your asynchronous function, that one will have to wait for the process running ends its part.
So, using such functions is not precise if you want your event to process each n seconds. prefer an interrupt handler.
TOXCCT >>> GEII power
|
|
|
|
|
nandha wrote:
What could be the problem.?
That you are relying on Sleep() , and assuming that time is consistent between computers, especially if they are running different OSs. Read this article on why time is not always accurate.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Get source of information, thank you.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Hi,
For SSL Tunneling for HTTP Proxy
connect command is CONNECT www.someaddress.com:5444(port) HTTP/1.0
But wt is the CONNECT command for Socks proxy
plz reply thanx
|
|
|
|
|
Is SSL a layer to, say, winsock or are you using SSL's buildin socket?
Kuphryn
|
|
|
|
|
Hello
I am working on a MFC SDI application.
On My one of the menu i am drawing something with the CDC which is Memory dc and is drawing in a bitmap.
Above mentioned CDC MemDC is global.
Now on Save
I am having two Options
save content of CDC to JPEG and
save as BMP.
Well I am using implementation fo ImageHandler (from Codeguru) so it works fine. With JPEG saving. It does uses the CDC for putting into JPEG image.
Now with BMP saving, previously i was using CDibSectionLite (from Codeguru) using the above Bitmap. I want to use CDC instead because of change in the design.
Is there any other way to save content of DC directly to the Bitmap file
Thanks in advance.
Sandeep
Leave your mark wherever you go
|
|
|
|