|
-
February 26th, 2010, 01:41 PM
#1
A question regarding RegSetValueEx
Here is the definition of RegSetValueEx,
LONG WINAPI RegSetValueEx(
__in HKEY hKey,
__in_opt LPCTSTR lpValueName,
__reserved DWORD Reserved,
__in DWORD dwType,
__in_opt const BYTE *lpData,
__in DWORD cbData
);
According to MSDN, If the data is of type REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, cbData must include the size of the terminating null character or characters. But I tried to specify the cbData without considering terminating null character, it still works. It means, for example, if lpData points to _T("dullboy"), I specify cbData as 14, it still works as I specify cbData as 16. Would anybody here explain why? Thanks for your inputs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|