- apply patch [ 903332 ] copy the bximage result to clipboard, etc by lukewarm

This commit is contained in:
Christophe Bothamy 2004-04-30 17:26:38 +00:00
parent 318cb5ade0
commit 12f4f45d9b
2 changed files with 37 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/*
* misc/bximage.c
* $Id: bxcommit.c,v 1.6 2004-04-28 17:56:47 cbothamy Exp $
* $Id: bxcommit.c,v 1.7 2004-04-30 17:26:38 cbothamy Exp $
*
* Commits a redolog file in a flat file for bochs images.
*
@ -27,6 +27,23 @@
#include <string.h>
#if !BX_HAVE_SNPRINTF
#include <stdarg.h>
/* XXX use real snprintf */
/* if they don't have snprintf, just use sprintf */
int snprintf (char *s, size_t maxlen, const char *format, ...)
{
va_list arg;
int done;
va_start (arg, format);
done = vsprintf (s, format, arg);
va_end (arg);
return done;
}
#endif /* !BX_HAVE_SNPRINTF */
#define uint8 Bit8u
#define uint16 Bit16u
#define uint32 Bit32u
@ -35,7 +52,7 @@
#include "../iodev/harddrv.h"
char *EOF_ERR = "ERROR: End of input";
char *rcsid = "$Id: bxcommit.c,v 1.6 2004-04-28 17:56:47 cbothamy Exp $";
char *rcsid = "$Id: bxcommit.c,v 1.7 2004-04-30 17:26:38 cbothamy Exp $";
char *divider = "========================================================================";
void myexit (int code)

View File

@ -1,19 +1,20 @@
/*
* misc/bximage.c
* $Id: bximage.c,v 1.19 2003-08-01 01:20:00 cbothamy Exp $
* $Id: bximage.c,v 1.20 2004-04-30 17:26:37 cbothamy Exp $
*
* Create empty hard disk or floppy disk images for bochs.
*
*/
#ifdef WIN32
# include <windows.h>
# include <conio.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#ifdef WIN32
# include <conio.h>
#endif
#include "config.h"
#include <string.h>
@ -26,7 +27,7 @@
#include "../iodev/harddrv.h"
char *EOF_ERR = "ERROR: End of input";
char *rcsid = "$Id: bximage.c,v 1.19 2003-08-01 01:20:00 cbothamy Exp $";
char *rcsid = "$Id: bximage.c,v 1.20 2004-04-30 17:26:37 cbothamy Exp $";
char *divider = "========================================================================";
/* menu data for choosing floppy/hard disk */
@ -485,6 +486,18 @@ int main()
printf ("\nI wrote %lld bytes to %s.\n", sectors*512, filename);
printf ("\nThe following line should appear in your bochsrc:\n");
printf (" %s\n", bochsrc_line);
#ifdef WIN32
if (OpenClipboard(NULL)) {
HGLOBAL hgClip;
EmptyClipboard();
hgClip = GlobalAlloc(GMEM_DDESHARE, (strlen(bochsrc_line) + 1));
strcpy((char *)GlobalLock(hgClip), bochsrc_line);
GlobalUnlock(hgClip);
SetClipboardData(CF_TEXT, hgClip);
CloseClipboard();
}
#endif
myexit(0);
// make picky compilers (c++, gcc) happy,