filenames.
+0.6.10 (?/??/2013):
+-------------------
+
+- Replaced hexadecimal error code with description if an error is
+ encountered when saving a screen shot.
+
+- Enable multiple screen shots: Rather than naming all screen shots
+ "screenshot.bmp", the name is now "screenshot_###.bmp", where "###" is a
+ sequence number, starting with "001".
+
0.6.9 (4/25/2013):
------------------
</tr>
<tr>
<td><i>F10</i></td>
- <td>Saves an image of the current screen in the file <tt>screenshot.bmp</tt> in the ESP's root directory</td>
+ <td>Saves an image of the current screen in the file <tt>screenshot_<tt class="variable">###</tt>.bmp</tt>, where <tt class="variable">###</tt> is a sequence number starting with <tt>001</tt>, in the ESP's root directory</td>
</tr>
<tr>
<td><i>F12</i> or (on some keyboards) <i>Eject</i></td>
#
# Revision history:
#
-# 0.6.9 -- Install gptsync on Macs if evidence of Windows found
+# 0.6.9 -- Install gptsync on Macs
# 0.6.8 -- Bug fix: ESP scan now uses "uniq".
# 0.6.6 -- Bug fix: Upgrade drivers when installed to EFI/BOOT. Also enable
# copying shim.efi and MokManager.efi over themselves.
static EFI_GUID ESPGuid = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } };
-static EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
+EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
{
EFI_STATUS Status;
UINTN HandleCount = 0;
EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName,
OUT UINT8 **FileData, OUT UINTN *FileDataLength);
+EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir);
EFI_STATUS egSaveFile(IN EFI_FILE* BaseDir OPTIONAL, IN CHAR16 *FileName,
IN UINT8 *FileData, IN UINTN FileDataLength);
#include "../refind/screen.h"
#include "../refind/lib.h"
#include "../include/refit_call_wrapper.h"
+#include "libeg.h"
#include <efiUgaDraw.h>
#include <efiConsoleControl.h>
UINT8 *FileData;
UINTN FileDataLength;
UINTN Index;
+ UINTN ssNum;
+ CHAR16 Filename[80];
+ EFI_FILE* BaseDir;
Image = egCopyScreen();
if (Image == NULL) {
goto bailout_wait;
}
+ Status = egFindESP(&BaseDir);
+ if (EFI_ERROR(Status))
+ return;
+
+ // Search for existing screen shot files; increment number to an unused value...
+ ssNum = 001;
+ do {
+ SPrint(Filename, 80, L"screenshot_%03d.bmp", ssNum++);
+ } while (FileExists(BaseDir, Filename));
+
// save to file on the ESP
- Status = egSaveFile(NULL, L"screenshot.bmp", FileData, FileDataLength);
+ Status = egSaveFile(BaseDir, Filename, FileData, FileDataLength);
FreePool(FileData);
- if (EFI_ERROR(Status)) {
- Print(L"Error egSaveFile: %x\n", Status);
+ if (CheckError(Status, L"in egSaveFile()")) {
goto bailout_wait;
}
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.9");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.9.1");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2013 Roderick W. Smith");