Does anybody know if it is possible, in an OS legal way, to change the stack size for an already running Process?
I've looked at exec/SwapStackStruct(struct StackSwapStruct*), which states that the existing stack bounds and usp are swapped with the ones in the structure, allowing you to restore it later.
What I want to be able to do, is to allocate an area of memory for the new stack, clone the existing stack area and then swap it in for the new one, the net result simply being that the stack has "grown" (and naturally lives at a different address) but otherwise contains all the same data it did before the swap, leaving the Task none the wiser.
I can see a lot of problems with this if it isn't done carefully and several questions spring to mind. First of all, if all you are doing is replacing the stack area (with no desire to restore it later with a repeated call to SwapStackStruct()), is it legal to release the memory? How is it allocated in the first place (which method) to ensure your replacement allocation would be correctly freed by the system?
Anybody know of any robust existing examples of this kind of thing?