ZenWINX Logo ZenWINX

Architecture - Reference Manual - Guides

Miscellaneous

Functions

void __stdcall winx_sleep (int msec)
 Suspends the execution of the current thread.
int __stdcall winx_get_os_version (void)
 Returns the version of Windows.
int __stdcall winx_get_windows_directory (char *buffer, int length)
 Retrieves the path of the Windows directory.
int __stdcall winx_query_symbolic_link (short *name, short *buffer, int length)
 Queries a symbolic link.
int __stdcall winx_set_system_error_mode (unsigned int mode)
 Sets a system error mode.
int __stdcall winx_load_driver (short *driver_name)
 Loads a driver.
int __stdcall winx_unload_driver (short *driver_name)
 Unloads a driver.
short *__stdcall winx_get_windows_boot_options (void)
 Retrieves the Windows boot options.
int __stdcall winx_windows_in_safe_mode (void)
 Determines whether Windows is in Safe Mode or not.

Function Documentation

void __stdcall winx_sleep ( int  msec  ) 

Suspends the execution of the current thread.

Parameters:
[in] msec the time interval, in milliseconds. If an INFINITE constant is passed, the time-out interval never elapses.

Definition at line 38 of file misc.c.

Referenced by kb_check(), and kb_open().

int __stdcall winx_get_os_version ( void   ) 

Returns the version of Windows.

Returns:
major_version_number * 10 + minor_version_number.
Note:
  • Works fine on NT 4.0 and later systems. Otherwise always returns 40.
  • Useless on Windows 9x. Though, the complete zenwinx library is useless there since there are many required calls missing in ntdll library on windows 9x.
Example:
 if(winx_get_os_version() >= 51){
     // we are running on XP or later system
 }

Definition at line 71 of file misc.c.

References winx_get_proc_address().

int __stdcall winx_get_windows_directory ( char *  buffer,
int  length 
)

Retrieves the path of the Windows directory.

Parameters:
[out] buffer pointer to the buffer to receive the null-terminated path.
[in] length the length of the buffer, in characters.
Returns:
Zero for success, negative value otherwise.
Note:
This function retrieves a native path, like this \??\C:\WINDOWS

Definition at line 92 of file misc.c.

References winx_query_env_variable().

int __stdcall winx_query_symbolic_link ( short *  name,
short *  buffer,
int  length 
)

Queries a symbolic link.

Parameters:
[in] name the name of symbolic link.
[out] buffer pointer to the buffer to receive the null-terminated target.
[in] length of the buffer, in characters.
Returns:
Zero for success, negative value otherwise.
Example:
 winx_query_symbolic_link(L"\\??\\C:",buffer,BUFFER_LENGTH);
 // now the buffer may contain \Device\HarddiskVolume1 or something like that

Definition at line 117 of file misc.c.

Referenced by winx_get_drive_type().

int __stdcall winx_set_system_error_mode ( unsigned int  mode  ) 

Sets a system error mode.

Parameters:
[in] mode the process error mode.
Returns:
Zero for success, negative value otherwise.
Note:
  • Mode constants aren't the same as in Win32 SetErrorMode() call.
  • Use INTERNAL_SEM_FAILCRITICALERRORS constant to disable the critical-error-handler message box. After that you can for example try to read a missing floppy disk without any popup windows displaying error messages.
  • winx_set_system_error_mode(1) call is equal to SetErrorMode(0).
  • Other mode constants can be found in ReactOS sources, but they needs to be tested meticulously because they were never officially documented.
Example:
 winx_set_system_error_mode(INTERNAL_SEM_FAILCRITICALERRORS);

Definition at line 167 of file misc.c.

int __stdcall winx_load_driver ( short *  driver_name  ) 

Loads a driver.

Parameters:
[in] driver_name the name of the driver exactly as written in system registry.
Returns:
Zero for success, negative value otherwise.
Note:
When the driver is already loaded this function returns success.

Definition at line 190 of file misc.c.

int __stdcall winx_unload_driver ( short *  driver_name  ) 

Unloads a driver.

Parameters:
[in] driver_name the name of the driver exactly as written in system registry.
Returns:
Zero for success, negative value otherwise.

Definition at line 216 of file misc.c.

short* __stdcall winx_get_windows_boot_options ( void   ) 

Retrieves the Windows boot options.

Returns:
Pointer to Unicode string containing all Windows boot options. NULL indicates failure.
Note:
After a use of returned string it should be freed by winx_heap_free() call.

Definition at line 243 of file misc.c.

References winx_heap_alloc(), winx_heap_free(), and winx_printf().

Referenced by winx_windows_in_safe_mode().

int __stdcall winx_windows_in_safe_mode ( void   ) 

Determines whether Windows is in Safe Mode or not.

Returns:
Positive value indicates the presence of the Safe Mode. Zero value indicates a normal boot. Negative value indicates indeterminism caused by impossibility of an appropriate check.

Definition at line 336 of file misc.c.

References winx_get_windows_boot_options(), and winx_heap_free().


Generated on Sat May 29 23:06:45 2010 for ZenWINX by doxygen 1.6.2