ReactOS 0.4.16-dev-1946-g52006dd
DllMain.c File Reference
#include "ntdll_vista.h"
Include dependency graph for DllMain.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI RtlpInitializeLocaleTable (VOID)
 
BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
 

Function Documentation

◆ DllMain()

BOOL WINAPI DllMain ( HANDLE  hDll,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 9 of file DllMain.c.

12{
14
16 {
20 if (!NT_SUCCESS(Status))
21 {
23 return FALSE;
24 }
25 }
26 else if (dwReason == DLL_PROCESS_DETACH)
27 {
29 }
30 return TRUE;
31}
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI LdrDisableThreadCalloutsForDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1154
DWORD dwReason
Definition: misc.cpp:135
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI RtlpInitializeLocaleTable(VOID)
Definition: locale.c:529
VOID NTAPI RtlpCloseKeyedEvent(VOID)
Definition: condvar.c:468
VOID NTAPI RtlpInitializeKeyedEvent(VOID)
Definition: condvar.c:460

◆ RtlpInitializeLocaleTable()

NTSTATUS NTAPI RtlpInitializeLocaleTable ( VOID  )

Definition at line 529 of file locale.c.

530{
531 PSORT_ENTRY SortTable;
532 SIZE_T SortTableSize;
533
536
537 SortTableSize = sizeof(SortTable[0]) * ARRAYSIZE(RtlpLocaleTable);
538 SortTable = RtlAllocateHeap(RtlGetProcessHeap(), 0, SortTableSize);
539 if (SortTable == NULL)
540 {
542 }
543
544 /* Copy the LCIDs and the index */
545 for (USHORT i = 0; i < ARRAYSIZE(RtlpLocaleTable); i++)
546 {
547 SortTable[i].Lcid = RtlpLocaleTable[i].Lcid;
548 SortTable[i].Index = i;
549 }
550
551 /* Sort the table by LCID */
552 qsort(SortTable,
554 sizeof(SortTable[0]),
556
557 /* Copy the sorted indices to the global table */
558 for (USHORT i = 0; i < ARRAYSIZE(RtlpLocaleTable); i++)
559 {
560 RtlpLocaleIndexTable[i] = SortTable[i].Index;
561 }
562
563 RtlFreeHeap(RtlGetProcessHeap(), 0, SortTable);
564
565 return STATUS_SUCCESS;
566}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:616
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:634
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
#define NULL
Definition: types.h:112
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS NTAPI NtQueryDefaultLocale(IN BOOLEAN UserProfile, OUT PLCID DefaultLocaleId)
Definition: locale.c:396
unsigned short USHORT
Definition: pedump.c:61
static USHORT RtlpLocaleIndexTable[_ARRAYSIZE(RtlpLocaleTable)]
Definition: locale.c:506
LCID RtlpUserDefaultLcid
Definition: locale.c:23
static const LOCALE_ENTRY RtlpLocaleTable[]
Definition: locale.c:34
LCID RtlpSystemDefaultLcid
Definition: locale.c:24
static int __cdecl LcidSortEntryCompare(const void *a, const void *b)
Definition: locale.c:515
#define STATUS_SUCCESS
Definition: shellext.h:65
LCID Lcid
Definition: locale.c:29
Definition: locale.c:509
LCID Lcid
Definition: locale.c:510
USHORT Index
Definition: locale.c:511
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by DllMain().