diff options
author | Regina König | 2020-08-20 23:45:00 +0200 |
---|---|---|
committer | Regina König | 2020-08-20 23:45:00 +0200 |
commit | 7cd08d2a4392a092693c690d7d1ff948a037fe4d (patch) | |
tree | 093c9ef9ea9fd6dff60dd79f0a5cfa03d8a357f6 /memtestEDK | |
parent | corrected OpenProtocol function call (diff) | |
download | memtest86-7cd08d2a4392a092693c690d7d1ff948a037fe4d.tar.gz memtest86-7cd08d2a4392a092693c690d7d1ff948a037fe4d.tar.xz memtest86-7cd08d2a4392a092693c690d7d1ff948a037fe4d.zip |
Am able to add a new line to file
Diffstat (limited to 'memtestEDK')
-rw-r--r-- | memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c index afd47ec..235d0b0 100644 --- a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c +++ b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c @@ -186,7 +186,7 @@ UefiMain ( 0); checkStatus(efiStatus, "Open"); - UINTN fileSize = 100; // TODO get the actual size + UINTN fileSize = 500; // TODO get the actual size CHAR16* fileBuffer = NULL; efiStatus = bs->AllocatePool(EfiLoaderData, (UINTN) (fileSize) , (void **)&fileBuffer); checkStatus(efiStatus, "AllocatePool for file"); @@ -201,14 +201,13 @@ UefiMain ( checkStatus(efiStatus, "GetPosition"); Print(L"Current File Position: %d\n", currPos); - fileBuffer[0] = (CHAR16) 'C'; // TODO create new buffer. What's the best practice? Extra function - fileBuffer[1] = (CHAR16) '\0'; - Console->OutputString(Console, fileBuffer); - UINTN length = 2; + char *message = "\nAdding a new line"; + UINTN length = 19; + Print(L"Lengh: %d\n", length); token->SetPosition(token, fileSize - 1); - efiStatus = token->Write(token, &length, fileBuffer); + efiStatus = token->Write(token, &length, message); checkStatus(efiStatus, "Write"); fileSize += length; @@ -216,7 +215,7 @@ UefiMain ( token->SetPosition(token, 0); efiStatus = token->Read(token, &fileSize, fileBuffer); - Print(L"File Content after write: %a\n", fileBuffer); + printFileContent(fileSize, fileBuffer); } // end if (compareGuids(&sfspGuid, guid)) } // end for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) |