ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 686 of file bootdata.c.

Referenced by RegistrationProc().

{
    OBJECT_ATTRIBUTES ObjectAttributes;
    IO_STATUS_BLOCK IoStatusBlock;
    LARGE_INTEGER AllocationSize;
    LARGE_INTEGER ByteOffset;
    UNICODE_STRING FileName;
    HANDLE FileHandle;
    NTSTATUS Status;

    /* Initialize the file name */
    RtlInitUnicodeString(&FileName,
                         L"\\SystemRoot\\bootstat.dat");

    /* Initialize the object attributes */
    InitializeObjectAttributes(&ObjectAttributes,
                               &FileName,
                               OBJ_CASE_INSENSITIVE,
                               NULL,
                               NULL);

    AllocationSize.QuadPart = 0x800;

    /* Create the boot status data file */
    Status = ZwCreateFile(&FileHandle,
                          FILE_GENERIC_READ | FILE_GENERIC_WRITE,
                          &ObjectAttributes,
                          &IoStatusBlock,
                          NULL, //&AllocationSize,
                          FILE_ATTRIBUTE_SYSTEM,
                          0,
                          FILE_CREATE,
                          FILE_SYNCHRONOUS_IO_NONALERT,
                          NULL,
                          0);
    if (NT_SUCCESS(Status))
    {
        // FIXME: Initialize the buffer in a better way.
        UCHAR Buffer[12] = {0xC,0,0,0, 1,0,0,0, 1, 0x1e, 1, 0};

        ByteOffset.QuadPart = 0;
        Status = ZwWriteFile(FileHandle,
                             NULL,
                             NULL,
                             NULL,
                             &IoStatusBlock,
                             &Buffer,
                             12, //BufferSize,
                             &ByteOffset,
                             NULL);
    }

    /* Close the file */
    ZwClose(FileHandle);

    return Status;
}

Generated on Sun May 27 2012 05:21:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.