From e89c456751df8433e9035f629bc8cb32a12f84b5 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Mon, 22 Jun 2009 20:15:42 +0000 Subject: [PATCH] modified dll/win32/kernel32/file/volume.c modified dll/win32/kernel32/misc/actctx.c modified dll/win32/kernel32/misc/lang.c C89 compliance modified dll/win32/kernel32/k32.h Include modified dll/win32/kernel32/misc/res.c Hey Arch, instead of copying and pasting definitions from , why don't you include it? svn path=/trunk/; revision=41560 --- reactos/dll/win32/kernel32/file/volume.c | 10 ++-- reactos/dll/win32/kernel32/k32.h | 1 + reactos/dll/win32/kernel32/misc/actctx.c | 4 +- reactos/dll/win32/kernel32/misc/lang.c | 6 +-- reactos/dll/win32/kernel32/misc/res.c | 60 +----------------------- 5 files changed, 13 insertions(+), 68 deletions(-) diff --git a/reactos/dll/win32/kernel32/file/volume.c b/reactos/dll/win32/kernel32/file/volume.c index 6107956412c..4648d7e1fa0 100644 --- a/reactos/dll/win32/kernel32/file/volume.c +++ b/reactos/dll/win32/kernel32/file/volume.c @@ -88,6 +88,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength, { DWORD drive, count; DWORD dwDriveMap; + LPSTR p; dwDriveMap = GetLogicalDrives(); @@ -100,7 +101,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength, if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1); - LPSTR p = lpBuffer; + p = lpBuffer; for (drive = 0; drive < MAX_DOS_DRIVES; drive++) if (dwDriveMap & (1< nBufferLength) return ((count * 4) + 1); - LPWSTR p = lpBuffer; + p = lpBuffer; for (drive = 0; drive < MAX_DOS_DRIVES; drive++) if (dwDriveMap & (1<NameLength; continue; } - else + else { NtClose(FileHandle); SetLastErrorByStatus(Status); @@ -1023,7 +1025,7 @@ GetVolumeNameForVolumeMountPointW( { MountPoint = MountPoints->MountPoints + Index; SymbolicLinkName = (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset; - + /* * Check for "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\" * (with the last slash being optional) style symbolic links. diff --git a/reactos/dll/win32/kernel32/k32.h b/reactos/dll/win32/kernel32/k32.h index 602642120ac..a47f9666a7f 100755 --- a/reactos/dll/win32/kernel32/k32.h +++ b/reactos/dll/win32/kernel32/k32.h @@ -27,6 +27,7 @@ /* C Headers */ #include +#include #include #include diff --git a/reactos/dll/win32/kernel32/misc/actctx.c b/reactos/dll/win32/kernel32/misc/actctx.c index 6d592867ded..3e81c9c2f9e 100644 --- a/reactos/dll/win32/kernel32/misc/actctx.c +++ b/reactos/dll/win32/kernel32/misc/actctx.c @@ -174,7 +174,7 @@ CreateActCtxW( DPRINT("CreateActCtxW(%p %08lx)\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0); - Status = RtlCreateActivationContext(&hActCtx, &pActCtx); + Status = RtlCreateActivationContext(&hActCtx, (PVOID*)&pActCtx); if (!NT_SUCCESS(Status)) { SetLastError(RtlNtStatusToDosError(Status)); @@ -318,6 +318,6 @@ ZombifyActCtx( SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } - + return TRUE; } diff --git a/reactos/dll/win32/kernel32/misc/lang.c b/reactos/dll/win32/kernel32/misc/lang.c index a6e58e2e809..52fe97bbb67 100644 --- a/reactos/dll/win32/kernel32/misc/lang.c +++ b/reactos/dll/win32/kernel32/misc/lang.c @@ -1550,10 +1550,10 @@ GetGeoInfoA( case GEO_FRIENDLYNAME: { WCHAR szBuffer[MAX_PATH]; - int Ret; - - Ret = NLS_GetGeoFriendlyName(Location, szBuffer, cchData); char szBufferA[sizeof(szBuffer)/sizeof(WCHAR)]; + int Ret; + + Ret = NLS_GetGeoFriendlyName(Location, szBuffer, cchData); WideCharToMultiByte(CP_ACP, 0, szBuffer, -1, szBufferA, sizeof(szBufferA), 0, 0); strcpy(lpGeoData, szBufferA); diff --git a/reactos/dll/win32/kernel32/misc/res.c b/reactos/dll/win32/kernel32/misc/res.c index db00fac780e..1b77a977418 100644 --- a/reactos/dll/win32/kernel32/misc/res.c +++ b/reactos/dll/win32/kernel32/misc/res.c @@ -13,6 +13,7 @@ */ #include +#include #define NDEBUG #include @@ -21,55 +22,6 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \ DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__) -/* Strustures and functions from include/wine/list.h */ -struct list -{ - struct list *next; - struct list *prev; -}; - -static inline void list_init( struct list *list ) -{ - list->next = list->prev = list; -} - -/* add an element before the specified one */ -static inline void list_add_before( struct list *elem, struct list *to_add ) -{ - to_add->next = elem; - to_add->prev = elem->prev; - elem->prev->next = to_add; - elem->prev = to_add; -} - -/* add element at the tail of the list */ -static inline void list_add_tail( struct list *list, struct list *elem ) -{ - list_add_before( list, elem ); -} - -/* remove an element from its list */ -static inline void list_remove( struct list *elem ) -{ - elem->next->prev = elem->prev; - elem->prev->next = elem->next; -} - -/* get the next element */ -static inline struct list *list_next( const struct list *list, const struct list *elem ) -{ - struct list *ret = elem->next; - if (elem->next == list) ret = NULL; - return ret; -} - -/* get the first element */ -static inline struct list *list_head( const struct list *list ) -{ - return list_next( list, list ); -} - - /* * Data structure for updating resources. * Type/Name/Language is a keyset for accessing resource data. @@ -264,16 +216,6 @@ static struct resource_data *allocate_resource_data( WORD Language, DWORD codepa return resdata; } -/* get pointer to object containing list element */ -#define LIST_ENTRY(elem, type, field) \ - ((type *)((char *)(elem) - (unsigned int)(&((type *)0)->field))) - -/* iterate through the list using a list entry */ -#define LIST_FOR_EACH_ENTRY(elem, list, type, field) \ - for ((elem) = LIST_ENTRY((list)->next, type, field); \ - &(elem)->field != (list); \ - (elem) = LIST_ENTRY((elem)->field.next, type, field)) - static void add_resource_dir_entry( struct list *dir, struct resource_dir_entry *resdir ) { struct resource_dir_entry *ent;