Author: hbelusca
Date: Thu Mar 10 18:31:52 2016
New Revision: 70992
URL:
http://svn.reactos.org/svn/reactos?rev=70992&view=rev
Log:
[DELAYIMP]: Whitespace fixes only (tabs -> spaces).
Modified:
trunk/reactos/include/psdk/delayimp.h
trunk/reactos/lib/sdk/delayimp/delayimp.c
Modified: trunk/reactos/include/psdk/delayimp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/delayimp.h?re…
==============================================================================
--- trunk/reactos/include/psdk/delayimp.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/delayimp.h [iso-8859-1] Thu Mar 10 18:31:52 2016
@@ -14,53 +14,53 @@
enum DLAttr
{
- dlattrRva = 0x1,
+ dlattrRva = 0x1,
};
/* Notification codes */
enum
{
- dliStartProcessing,
- dliNotePreLoadLibrary,
- dliNotePreGetProcAddress,
- dliFailLoadLib,
- dliFailGetProc,
- dliNoteEndProcessing,
+ dliStartProcessing,
+ dliNotePreLoadLibrary,
+ dliNotePreGetProcAddress,
+ dliFailLoadLib,
+ dliFailGetProc,
+ dliNoteEndProcessing,
};
typedef struct ImgDelayDescr
{
- DWORD grAttrs;
- RVA rvaDLLName;
- RVA rvaHmod;
- RVA rvaIAT;
- RVA rvaINT;
- RVA rvaBoundIAT;
- RVA rvaUnloadIAT;
- DWORD dwTimeStamp;
+ DWORD grAttrs;
+ RVA rvaDLLName;
+ RVA rvaHmod;
+ RVA rvaIAT;
+ RVA rvaINT;
+ RVA rvaBoundIAT;
+ RVA rvaUnloadIAT;
+ DWORD dwTimeStamp;
} ImgDelayDescr, *PImgDelayDescr;
typedef const ImgDelayDescr *PCImgDelayDescr;
typedef struct DelayLoadProc
{
- BOOL fImportByName;
- union
- {
- LPCSTR szProcName;
- DWORD dwOrdinal;
- };
+ BOOL fImportByName;
+ union
+ {
+ LPCSTR szProcName;
+ DWORD dwOrdinal;
+ };
} DelayLoadProc;
typedef struct DelayLoadInfo
{
- DWORD cb;
- PCImgDelayDescr pidd;
- FARPROC *ppfn;
- LPCSTR szDll;
- DelayLoadProc dlp;
- HMODULE hmodCur;
- FARPROC pfnCur;
- DWORD dwLastError;
+ DWORD cb;
+ PCImgDelayDescr pidd;
+ FARPROC *ppfn;
+ LPCSTR szDll;
+ DelayLoadProc dlp;
+ HMODULE hmodCur;
+ FARPROC pfnCur;
+ DWORD dwLastError;
} DelayLoadInfo, *PDelayLoadInfo;
typedef FARPROC (WINAPI *PfnDliHook)(unsigned, PDelayLoadInfo);
@@ -69,7 +69,7 @@
unsigned
IndexFromPImgThunkData(PCImgThunkData pData, PCImgThunkData pBase)
{
- return pData - pBase;
+ return pData - pBase;
}
extern const IMAGE_DOS_HEADER __ImageBase;
@@ -78,7 +78,7 @@
PVOID
PFromRva(RVA rva)
{
- return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&__ImageBase));
+ return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&__ImageBase));
}
Modified: trunk/reactos/lib/sdk/delayimp/delayimp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/delayimp/delayimp.…
==============================================================================
--- trunk/reactos/lib/sdk/delayimp/delayimp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/delayimp/delayimp.c [iso-8859-1] Thu Mar 10 18:31:52 2016
@@ -17,71 +17,71 @@
FARPROC WINAPI
__delayLoadHelper2(PCImgDelayDescr pidd, PImgThunkData pIATEntry)
{
- DelayLoadInfo dli;
- int index;
- PImgThunkData pIAT;
- PImgThunkData pINT;
- HMODULE *phMod;
- FARPROC pProc;
+ DelayLoadInfo dli;
+ int index;
+ PImgThunkData pIAT;
+ PImgThunkData pINT;
+ HMODULE *phMod;
+ FARPROC pProc;
- pIAT = PFromRva(pidd->rvaIAT);
- pINT = PFromRva(pidd->rvaINT);
- phMod = PFromRva(pidd->rvaHmod);
- index = IndexFromPImgThunkData(pIATEntry, pIAT);
+ pIAT = PFromRva(pidd->rvaIAT);
+ pINT = PFromRva(pidd->rvaINT);
+ phMod = PFromRva(pidd->rvaHmod);
+ index = IndexFromPImgThunkData(pIATEntry, pIAT);
- dli.cb = sizeof(dli);
- dli.pidd = pidd;
- dli.ppfn = (FARPROC*)pIATEntry->u1.Function;
- dli.szDll = PFromRva(pidd->rvaDLLName);
- dli.dlp.fImportByName = !(pINT[index].u1.Ordinal & IMAGE_ORDINAL_FLAG);
- if (dli.dlp.fImportByName)
- {
- /* u1.AdressOfData points to a IMAGE_IMPORT_BY_NAME struct */
- PIMAGE_IMPORT_BY_NAME piibn = PFromRva((RVA)pINT[index].u1.AddressOfData);
- dli.dlp.szProcName = (LPCSTR)&piibn->Name;
- }
- else
- {
- dli.dlp.dwOrdinal = pINT[index].u1.Ordinal & ~IMAGE_ORDINAL_FLAG;
- }
- dli.hmodCur = *phMod;
- dli.pfnCur = (FARPROC)pIAT[index].u1.Function;
- dli.dwLastError = GetLastError();
- pProc = __pfnDliNotifyHook2(dliStartProcessing, &dli);
- if (pProc)
- {
- pIAT[index].u1.Function = (DWORD_PTR)pProc;
- return pProc;
- }
+ dli.cb = sizeof(dli);
+ dli.pidd = pidd;
+ dli.ppfn = (FARPROC*)pIATEntry->u1.Function;
+ dli.szDll = PFromRva(pidd->rvaDLLName);
+ dli.dlp.fImportByName = !(pINT[index].u1.Ordinal & IMAGE_ORDINAL_FLAG);
+ if (dli.dlp.fImportByName)
+ {
+ /* u1.AdressOfData points to a IMAGE_IMPORT_BY_NAME struct */
+ PIMAGE_IMPORT_BY_NAME piibn = PFromRva((RVA)pINT[index].u1.AddressOfData);
+ dli.dlp.szProcName = (LPCSTR)&piibn->Name;
+ }
+ else
+ {
+ dli.dlp.dwOrdinal = pINT[index].u1.Ordinal & ~IMAGE_ORDINAL_FLAG;
+ }
+ dli.hmodCur = *phMod;
+ dli.pfnCur = (FARPROC)pIAT[index].u1.Function;
+ dli.dwLastError = GetLastError();
+ pProc = __pfnDliNotifyHook2(dliStartProcessing, &dli);
+ if (pProc)
+ {
+ pIAT[index].u1.Function = (DWORD_PTR)pProc;
+ return pProc;
+ }
- if (dli.hmodCur == NULL)
- {
- dli.hmodCur = LoadLibraryA(dli.szDll);
- if (!dli.hmodCur)
- {
- dli.dwLastError = GetLastError();
- __pfnDliFailureHook2(dliFailLoadLib, &dli);
-// if (ret)
-// {
-// }
- // FIXME: raise exception;
- return NULL;
- }
- *phMod = dli.hmodCur;
- }
+ if (dli.hmodCur == NULL)
+ {
+ dli.hmodCur = LoadLibraryA(dli.szDll);
+ if (!dli.hmodCur)
+ {
+ dli.dwLastError = GetLastError();
+ __pfnDliFailureHook2(dliFailLoadLib, &dli);
+// if (ret)
+// {
+// }
+ // FIXME: raise exception;
+ return NULL;
+ }
+ *phMod = dli.hmodCur;
+ }
- /* dli.dlp.szProcName might also contain the ordinal */
- pProc = GetProcAddress(dli.hmodCur, dli.dlp.szProcName);
- if (!pProc)
- {
- dli.dwLastError = GetLastError();
- __pfnDliFailureHook2(dliFailGetProc, &dli);
- // FIXME: handle return value & raise exception
- return NULL;
- }
- pIAT[index].u1.Function = (DWORD_PTR)pProc;
+ /* dli.dlp.szProcName might also contain the ordinal */
+ pProc = GetProcAddress(dli.hmodCur, dli.dlp.szProcName);
+ if (!pProc)
+ {
+ dli.dwLastError = GetLastError();
+ __pfnDliFailureHook2(dliFailGetProc, &dli);
+ // FIXME: handle return value & raise exception
+ return NULL;
+ }
+ pIAT[index].u1.Function = (DWORD_PTR)pProc;
- return pProc;
+ return pProc;
}
/*** The default hooks ***/
@@ -89,13 +89,13 @@
FARPROC WINAPI
DefaultDliNotifyHook2(unsigned dliNotify, PDelayLoadInfo pdli)
{
- return NULL;
+ return NULL;
}
FARPROC WINAPI
DefaultDliFailureHook2(unsigned dliNotify, PDelayLoadInfo pdli)
{
- return NULL;
+ return NULL;
}
PfnDliHook __pfnDliNotifyHook2 = DefaultDliNotifyHook2;