PDRIVER_OBJECT driver__obj_ptr = NULL;
/* Contains TXTSETUP.SIF/BOOT.INI-style OsLoadOptions parameters */
-LPWSTR driver__os_load_opts = NULL;
+LPWSTR os_load_opts = NULL;
static LPWSTR STDCALL
get_opt (
size_t opt_name_len,
opt_name_len_bytes;
- if ( !driver__os_load_opts || !opt_name )
+ if ( !os_load_opts || !opt_name )
return NULL;
/*
* Find /WINVBLOCK= options
*/
- our_opts = driver__os_load_opts;
+ our_opts = os_load_opts;
while ( *our_opts != L'\0' )
{
if ( RtlCompareMemory ( our_opts, our_sig, our_sig_len_bytes ) !=
if ( Driver_Globals_Started )
return STATUS_SUCCESS;
Debug_Initialize ( );
+ if ( !NT_SUCCESS ( Status = registry__note_os_load_opts ( &os_load_opts ) ) )
+ return Error ( "registry__note_os_load_opts", Status );
if ( !NT_SUCCESS ( Status = Registry_Check ( ) ) )
return Error ( "Registry_Check", Status );
Protocol_Stop ( );
AoE_Stop ( );
Bus_Stop ( );
+ ExFreePool ( os_load_opts );
Driver_Globals_Started = FALSE;
DBG ( "Done\n" );
}
/**
* Note BOOT.INI-style OsLoadOptions from registry
*
+ * @v w_str_ptr Pointer to pointer to wide-char string to hold options
* @ret ntstatus NT status
*
- * Somewhere we must eventually free Registry_Globals_OsLoadOptions.
+ * The caller must eventually free the wide-char string.
*/
-static NTSTATUS
-Registry_NoteOsLoadOptions (
- void
+NTSTATUS
+registry__note_os_load_opts (
+ LPWSTR * w_str_ptr
)
{
NTSTATUS status;
* Put the SystemStartOptions value into a global
*/
status =
- registry__fetch_sz ( control_key, L"SystemStartOptions",
- &driver__os_load_opts );
+ registry__fetch_sz ( control_key, L"SystemStartOptions", w_str_ptr );
if ( !NT_SUCCESS ( status ) )
goto err_fetchsz;
- DBG ( "OsLoadOptions: %S\n", driver__os_load_opts );
+ DBG ( "OsLoadOptions: %S\n", *w_str_ptr );
- /*
- * We do not free this global
- */
err_fetchsz:
registry__close_key ( control_key );
{
DBG ( "Registry updated\n" );
}
- Registry_NoteOsLoadOptions ( );
return STATUS_SUCCESS;
}
extern irp__handling driver__handling_table[];
extern size_t driver__handling_table_size;
-extern LPWSTR driver__os_load_opts;
extern PDRIVER_OBJECT driver__obj_ptr;
/* Forward declaration */
void
);
+/**
+ * Note BOOT.INI-style OsLoadOptions from registry
+ *
+ * @v w_str_ptr Pointer to pointer to wide-char string to hold options
+ * @ret ntstatus NT status
+ *
+ * The caller must eventually free the wide-char string.
+ */
+extern NTSTATUS registry__note_os_load_opts (
+ LPWSTR * w_str_ptr
+ );
+
/**
* Open registry key
*