07-23-2023, 09:01 AM
Use:
<!-- language: lang-c -->
/*
Creates an empty file, which can take all of the disk
space. Just specify the desired file size on the
command line.
*/
#include <windows.h>
#include <stdlib.h>
int main (int argc, char* ARGV[])
{
int size;
size = atoi(ARGV[1]);
const char* full = "fulldisk.dsk";
HANDLE hf = CreateFile(full,
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
0,
0);
SetFilePointer(hf, size, 0, FILE_BEGIN);
SetEndOfFile(hf);
CloseHandle(hf);
return 0;
}
<!-- language: lang-c -->
/*
Creates an empty file, which can take all of the disk
space. Just specify the desired file size on the
command line.
*/
#include <windows.h>
#include <stdlib.h>
int main (int argc, char* ARGV[])
{
int size;
size = atoi(ARGV[1]);
const char* full = "fulldisk.dsk";
HANDLE hf = CreateFile(full,
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
0,
0);
SetFilePointer(hf, size, 0, FILE_BEGIN);
SetEndOfFile(hf);
CloseHandle(hf);
return 0;
}