ReactOS 0.4.15-dev-7834-g00c4b3d
propvar.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for propvar.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Typedefs

typedef PVOID PPMemoryAllocator
 
typedef PVOID PSERIALIZEDPROPERTYVALUE
 

Functions

PVOID LoadOle32Export (PVOID *BaseAddress, const PCHAR ProcedureName)
 
ULONG NTAPI PropertyLengthAsVariant (IN PSERIALIZEDPROPERTYVALUE pProp, IN ULONG cbProp, IN USHORT CodePage, IN BYTE bReserved)
 
BOOLEAN NTAPI RtlConvertPropertyToVariant (IN PSERIALIZEDPROPERTYVALUE prop, IN USHORT CodePage, OUT PROPVARIANT *pvar, IN PPMemoryAllocator pma)
 
PSERIALIZEDPROPERTYVALUE NTAPI RtlConvertVariantToProperty (IN const PROPVARIANT *pvar, IN USHORT CodePage, OUT PSERIALIZEDPROPERTYVALUE pprop OPTIONAL, IN OUT PULONG pcb, IN PROPID pid, IN BOOLEAN fReserved, IN OUT PULONG pcIndirect OPTIONAL)
 

Variables

UNICODE_STRING Old32Dll = RTL_CONSTANT_STRING(L"ole32.dll")
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file propvar.c.

Typedef Documentation

◆ PPMemoryAllocator

Definition at line 26 of file propvar.c.

◆ PSERIALIZEDPROPERTYVALUE

Definition at line 27 of file propvar.c.

Function Documentation

◆ LoadOle32Export()

PVOID LoadOle32Export ( PVOID BaseAddress,
const PCHAR  ProcedureName 
)

Definition at line 33 of file propvar.c.

34{
36 ANSI_STRING ExportName;
37 PVOID ProcedureAddress;
38
39 /* First load ole32.dll */
41 if (!NT_SUCCESS(Status))
42 {
44 }
45
46 RtlInitAnsiString(&ExportName, ProcedureName);
47
48 /* Look for the procedure */
50 0, &ProcedureAddress);
51 if (!NT_SUCCESS(Status))
52 {
54 }
55
56 /* Return its address */
57 return ProcedureAddress;
58}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI DECLSPEC_HOTPATCH LdrLoadDll(_In_opt_ PWSTR SearchPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *BaseAddress)
Definition: ldrapi.c:312
NTSTATUS NTAPI LdrGetProcedureAddress(_In_ PVOID BaseAddress, _In_opt_ _When_(Ordinal==0, _Notnull_) PANSI_STRING Name, _In_opt_ _When_(Name==NULL, _In_range_(>, 0)) ULONG Ordinal, _Out_ PVOID *ProcedureAddress)
Definition: ldrapi.c:829
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
UNICODE_STRING Old32Dll
Definition: propvar.c:18

Referenced by PropertyLengthAsVariant(), RtlConvertPropertyToVariant(), and RtlConvertVariantToProperty().

◆ PropertyLengthAsVariant()

ULONG NTAPI PropertyLengthAsVariant ( IN PSERIALIZEDPROPERTYVALUE  pProp,
IN ULONG  cbProp,
IN USHORT  CodePage,
IN BYTE  bReserved 
)

Definition at line 65 of file propvar.c.

69{
70 ULONG Length = 0;
72 ULONG (*ProcedureAddress)(PSERIALIZEDPROPERTYVALUE, ULONG, USHORT, BYTE);
73
75 {
76 /* Simply call the appropriate Ole32 export */
77 ProcedureAddress = LoadOle32Export(&BaseAddress,
78 "StgPropertyLengthAsVariant");
79
80 Length = ProcedureAddress(pProp, cbProp, CodePage, bReserved);
81 }
83 {
84 if (BaseAddress != NULL)
85 {
87 }
88 }
90
91 return Length;
92}
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
NTSTATUS NTAPI LdrUnloadDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1331
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
unsigned short USHORT
Definition: pedump.c:61
PVOID LoadOle32Export(PVOID *BaseAddress, const PCHAR ProcedureName)
Definition: propvar.c:33
PVOID PSERIALIZEDPROPERTYVALUE
Definition: propvar.c:27
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193

◆ RtlConvertPropertyToVariant()

BOOLEAN NTAPI RtlConvertPropertyToVariant ( IN PSERIALIZEDPROPERTYVALUE  prop,
IN USHORT  CodePage,
OUT PROPVARIANT *  pvar,
IN PPMemoryAllocator  pma 
)

Definition at line 99 of file propvar.c.

103{
106 BOOLEAN (*ProcedureAddress)(PSERIALIZEDPROPERTYVALUE, USHORT, PROPVARIANT*, PPMemoryAllocator);
107
109 {
110 /* Simply call the appropriate Ole32 export */
111 ProcedureAddress = LoadOle32Export(&BaseAddress,
112 "StgConvertPropertyToVariant");
113
114 Success = ProcedureAddress(prop, CodePage, pvar, pma);
115 }
117 {
118 if (BaseAddress != NULL)
119 {
121 }
122 }
123 _SEH2_END;
124
125 return Success;
126}
unsigned char BOOLEAN
#define FALSE
Definition: types.h:117
@ Success
Definition: eventcreate.c:712
#define BOOLEAN
Definition: pedump.c:73
PVOID PPMemoryAllocator
Definition: propvar.c:26

◆ RtlConvertVariantToProperty()

PSERIALIZEDPROPERTYVALUE NTAPI RtlConvertVariantToProperty ( IN const PROPVARIANT *  pvar,
IN USHORT  CodePage,
OUT PSERIALIZEDPROPERTYVALUE pprop  OPTIONAL,
IN OUT PULONG  pcb,
IN PROPID  pid,
IN BOOLEAN  fReserved,
IN OUT PULONG pcIndirect  OPTIONAL 
)

Definition at line 133 of file propvar.c.

140{
141 PSERIALIZEDPROPERTYVALUE Serialized = NULL;
143 PSERIALIZEDPROPERTYVALUE (*ProcedureAddress)(const PROPVARIANT*, USHORT, PSERIALIZEDPROPERTYVALUE,
145
147 {
148 /* Simply call the appropriate Ole32 export */
149 ProcedureAddress = LoadOle32Export(&BaseAddress,
150 "StgConvertVariantToProperty");
151
152 Serialized = ProcedureAddress(pvar, CodePage, pprop, pcb, pid, fReserved, pcIndirect);
153 }
155 {
156 if (BaseAddress != NULL)
157 {
159 }
160 }
161 _SEH2_END;
162
163 return Serialized;
164}
static const CLSID IPropertyStorage UINT *static const PROPSPEC PROPVARIANT *static UINT const PROPSPEC PROPVARIANT PROPID
Definition: shellole.c:78
uint32_t * PULONG
Definition: typedefs.h:59
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

Variable Documentation

◆ Old32Dll

UNICODE_STRING Old32Dll = RTL_CONSTANT_STRING(L"ole32.dll")

Definition at line 18 of file propvar.c.

Referenced by LoadOle32Export().