12/04/2008

Misc Information

1. Using Driver Verifier to identify issues with Windows drivers for advanced users
http://support.microsoft.com/kb/244617
To enable Driver Verifier by editing the registry, follow these steps: Start Registry Editor (Regedt32). Locate the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\VerifyDriversEdit the REG_SZ key.Set the REG_SZ key to the case-insensitive names of the drivers that you want to test.

2. Why CreateProcess failed in Unicode project with an access violation.
e.g:
CreateProcess( NULL, _T("test.exe"), NULL, ....) will fail with an unhandled exception in a UNICODE project.

MSDN:
The Unicode version of this function, CreateProcessW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation.

3. Sometimes you may experience CreateFile failed with error code 5(Access is Denied) .
Security descriptors contain the security information associated with securable objects. For most securable objects, you can specify an object's security descriptor in the function call that creates the object.
Specifying a Security Descriptor From an INF File
http://msdn.microsoft.com/en-us/library/aa377450.aspx

For example, the following INF file snippet would create a registry key to which only administrators and the system have access. Note that this example requires administrative privileges.

 [DDInstall]
AddReg=mydevice.reg
 
[mydevice.reg]
include Registry information here
 
[mydevice.reg.Security]
"D:P(A;CI;GA;;;BA)(A;CI;GA;;;SY)"

SDDL for Device Objects
http://msdn.microsoft.com/en-us/library/ms794693.aspx

No comments: