Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

random.c File Reference

Go to the source code of this file.

Functions

DWORD RtlGetExpWinVer (HANDLE hmod)
DWORD FindCharPosition (LPWSTR lpString, WCHAR ch)
UINT TextCopy (PLARGE_UNICODE_STRING pstr, LPWSTR pszDst, UINT cchMax)
DWORD wcsncpycch (LPWSTR dest, LPCWSTR source, DWORD count)
DWORD strncpycch (LPSTR dest, LPCSTR source, DWORD count)


Function Documentation

DWORD FindCharPosition LPWSTR  lpString,
WCHAR  ch
 

Definition at line 80 of file w32/ntuser/rtl/random.c.

References DWORD, and L.

Referenced by MNRecalcTabStrings(), xxxDlgDirListHelper(), xxxMNItemSize(), and xxxRealDrawMenuItem().

00083 { 00084 DWORD dwPos = 0L; 00085 00086 while (*lpString && *lpString != ch) { 00087 ++lpString; 00088 ++dwPos; 00089 } 00090 return dwPos; 00091 }

DWORD RtlGetExpWinVer HANDLE  hmod  ) 
 

Definition at line 28 of file w32/ntuser/rtl/random.c.

References BYTE, DWORD, FALSE, NULL, and RtlImageNtHeader().

Referenced by xxxCreateThreadInfo().

00030 { 00031 PIMAGE_NT_HEADERS pnthdr; 00032 DWORD dwMajor = 3; 00033 DWORD dwMinor = 0xA; 00034 00035 /* 00036 * If it doesn't look like a valid 32bit hmod, use the default 00037 * (i.e., assuming all 16bit hmods are 0x30a) 00038 */ 00039 if ((hmod != NULL) && (LOWORD(HandleToUlong(hmod)) == 0)) { 00040 try { 00041 pnthdr = RtlImageNtHeader((PVOID)hmod); 00042 dwMajor = pnthdr->OptionalHeader.MajorSubsystemVersion; 00043 /* 00044 * Still need this hack 'cuz the linker still puts 00045 * version 1.00 in the header of some things. 00046 */ 00047 if (dwMajor == 1) { 00048 dwMajor = 0x3; 00049 } else { 00050 dwMinor = pnthdr->OptionalHeader.MinorSubsystemVersion; 00051 } 00052 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00053 dwMajor = 3; // just to be safe 00054 dwMinor = 0xA; 00055 } 00056 } 00057 00058 00059 /* 00060 * Return this is a win3.1 compatible format: 00061 * 00062 * 0x030A == win3.1 00063 * 0x0300 == win3.0 00064 * 0x0200 == win2.0, etc. 00065 */ 00066 00067 return (DWORD)MAKELONG(MAKEWORD((BYTE)dwMinor, (BYTE)dwMajor), 0); 00068 }

DWORD strncpycch LPSTR  dest,
LPCSTR  source,
DWORD  count
 

Definition at line 184 of file w32/ntuser/rtl/random.c.

References DWORD.

Referenced by CopyOutputString(), and xxxInterSendMsgEx().

00189 { 00190 LPSTR start = dest; 00191 00192 while (count && (*dest++ = *source++)) /* copy string */ 00193 count--; 00194 00195 return (DWORD)(dest - start); 00196 }

UINT TextCopy PLARGE_UNICODE_STRING  pstr,
LPWSTR  pszDst,
UINT  cchMax
 

Definition at line 108 of file w32/ntuser/rtl/random.c.

References _LARGE_UNICODE_STRING::Buffer, _LARGE_UNICODE_STRING::Length, min, and UINT.

Referenced by _GetAltTabInfo(), DlgDirSelectHelper(), DrawSwitchWndHilite(), NtUserInternalGetWindowText(), xxxDefWindowProc(), xxxDrawCaptionTemp(), and xxxSetFrameTitle().

00112 { 00113 if (cchMax != 0) { 00114 cchMax = min(pstr->Length / sizeof(WCHAR), cchMax - 1); 00115 RtlCopyMemory(pszDst, (PVOID)pstr->Buffer, cchMax * sizeof(WCHAR)); 00116 pszDst[cchMax] = 0; 00117 } 00118 00119 return cchMax; 00120 }

DWORD wcsncpycch LPWSTR  dest,
LPCWSTR  source,
DWORD  count
 

Definition at line 146 of file w32/ntuser/rtl/random.c.

References DWORD.

Referenced by _GetKeyNameText(), CopyOutputString(), CreateDlgFont(), FixupDlgFaceName(), GetActiveKeyboardName(), GetDefaultWallpaperName(), LoadKeyboardLayoutFile(), NtUserCreateWindowStation(), NtUserGetKeyboardLayoutName(), xxxInterSendMsgEx(), and xxxShowTooltip().

00151 { 00152 LPWSTR start = dest; 00153 00154 while (count && (*dest++ = *source++)) /* copy string */ 00155 count--; 00156 00157 return (DWORD)(dest - start); 00158 }


Generated on Sat May 15 19:45:26 2004 for test by doxygen 1.3.7