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.
 
 
 
 
 
 

72 lines
1.4 KiB

#include "pch.h"
#pragma hdrstop
#include "utils.h"
DEFINE_MODULE( "RIPREP" )
TCHAR gBuffer0[5000];
TCHAR gBuffer1[5000];
INT
MessageBoxFromMessageV(
IN HWND Window,
IN DWORD MessageId,
IN BOOL SystemMessage,
IN LPCTSTR CaptionString,
IN UINT Style,
IN va_list *Args
)
{
if((DWORD_PTR)CaptionString > 0xffff) {
//
// It's a string already.
//
lstrcpyn(gBuffer0,CaptionString, ARRAYSIZE(gBuffer0));
} else {
//
// It's a string id
//
if(!LoadString(g_hinstance,PtrToUlong(CaptionString),gBuffer0, ARRAYSIZE(gBuffer0))) {
gBuffer0[0] = 0;
}
}
FormatMessage(
SystemMessage ? FORMAT_MESSAGE_FROM_SYSTEM : FORMAT_MESSAGE_FROM_HMODULE,
NULL,
MessageId,
0,
gBuffer1,
ARRAYSIZE(gBuffer1),
Args
);
return(MessageBox(Window,gBuffer1,gBuffer0,Style));
}
INT
MessageBoxFromMessage(
IN HWND Window,
IN DWORD MessageId,
IN BOOL SystemMessage,
IN LPCTSTR CaptionString,
IN UINT Style,
...
)
{
va_list arglist;
INT i;
va_start(arglist,Style);
i = MessageBoxFromMessageV(Window,MessageId,SystemMessage,CaptionString,Style,&arglist);
va_end(arglist);
return(i);
}