Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

49 lines
999 B

/*++
Copyright (c) 2001 Microsoft Corporation
All rights reserved
Module Name:
algndjmp.c
Abstract:
This file wraps around setjmp/longjmp functions to fix up alignment
problems created by UFL memory management.
Author:
Larry Zhu (LZhu) 11-Apr-2001 Created
Environment:
User Mode -Win32
Revision History:
--*/
#include "algndjmp.h"
//
// Don't EVER copy jmp_buf when returning from longjmp, because at the time
// when it returns from longjmp, stack variable PS_AlignedJmpBuf maybe is
// totaly trashed!
//
// Don't EVER try to call setjmp in this function, because that will change
// the stack when setjmp is called, hence return address and stack pointer
// registers etc.
//
void
PS_CopyJmpBuf(
IN int iSetjmpRetVal,
OUT jmp_buf envDest,
IN jmp_buf envSrc
)
{
if (!iSetjmpRetVal)
{
(void)memcpy(envDest, envSrc, sizeof(jmp_buf));
}
}