Application to Kernel Comm.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
VoidLogic

Application to Kernel Comm.

Post by VoidLogic »

Application to Kernel Comm:

I was planing on using stucts and pointers to memory. ie:
(This is more of and advanced shell so DOS is present)

I.   Kernel Startup..etc etc etc
II.  The Kernel gets the command from user\script to load an app\driver
III. The Kernal calls the the .exe (ie PrntSrv.exe /0x1b2c0ffe *)

*Now here is where the problem comes in. How can I take that cstring (which is the pointer to the kernels process communication area) and and turn is back to a pointer? it can be made numeral value via stdlibs atol() funtion but how can i give that value to a pointer (dumb type checking makes it hard)?

Plz Help :) -VoidLogic
anton

RE:Application to Kernel Comm.

Post by anton »

int i=0x1b2c0ffe;
char* data=(char*)(void*)i;
Anton
Keith

RE:Application to Kernel Comm.

Post by Keith »

All you need is one cast...either (void *) or (char *), not both.  As long as this is real C, pointers-to-void can be cast automatically to the type of the lvalue.
VoidLogic

RE:Application to Kernel Comm.

Post by VoidLogic »

I mean the opposte:
-I have a cstring = "0x1b2c0ffe"
-This cssring is converted to an long via atol
-Now I need too set the value in this long into a long ptr

srting Bob = "0x1b2c0ffe";
long BobVal = atol(Bob);
long *BobPtr = BobVal ?? ERR ?? I can't get this to cast, how?

Thanx for you help,
-VoidLogic
Keith

RE:Application to Kernel Comm.

Post by Keith »

long *BobPtr = (long *)BobVal;

Standard casting here.
VoidLogic

RE:Application to Kernel Comm.

Post by VoidLogic »

Thank you, My Programming teacher tought us a different method of cast pointer that did not work for this, your godsend
Post Reply