github.com/gofiber/fiber/v2@v2.47.0/internal/go-ole/com_func.go (about) 1 //go:build !windows 2 // +build !windows 3 4 package ole 5 6 import ( 7 "time" 8 "unsafe" 9 ) 10 11 // coInitialize initializes COM library on current thread. 12 // 13 // MSDN documentation suggests that this function should not be called. Call 14 // CoInitializeEx() instead. The reason has to do with threading and this 15 // function is only for single-threaded apartments. 16 // 17 // That said, most users of the library have gotten away with just this 18 // function. If you are experiencing threading issues, then use 19 // CoInitializeEx(). 20 func coInitialize() error { 21 return NewError(E_NOTIMPL) 22 } 23 24 // coInitializeEx initializes COM library with concurrency model. 25 func coInitializeEx(coinit uint32) error { 26 return NewError(E_NOTIMPL) 27 } 28 29 // CoInitialize initializes COM library on current thread. 30 // 31 // MSDN documentation suggests that this function should not be called. Call 32 // CoInitializeEx() instead. The reason has to do with threading and this 33 // function is only for single-threaded apartments. 34 // 35 // That said, most users of the library have gotten away with just this 36 // function. If you are experiencing threading issues, then use 37 // CoInitializeEx(). 38 func CoInitialize(p uintptr) error { 39 return NewError(E_NOTIMPL) 40 } 41 42 // CoInitializeEx initializes COM library with concurrency model. 43 func CoInitializeEx(p uintptr, coinit uint32) error { 44 return NewError(E_NOTIMPL) 45 } 46 47 // CoUninitialize uninitializes COM Library. 48 func CoUninitialize() {} 49 50 // CoTaskMemFree frees memory pointer. 51 func CoTaskMemFree(memptr uintptr) {} 52 53 // CLSIDFromProgID retrieves Class Identifier with the given Program Identifier. 54 // 55 // The Programmatic Identifier must be registered, because it will be looked up 56 // in the Windows Registry. The registry entry has the following keys: CLSID, 57 // Insertable, Protocol and Shell 58 // (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx). 59 // 60 // programID identifies the class id with less precision and is not guaranteed 61 // to be unique. These are usually found in the registry under 62 // HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of 63 // "Program.Component.Version" with version being optional. 64 // 65 // CLSIDFromProgID in Windows API. 66 func CLSIDFromProgID(progId string) (*GUID, error) { 67 return nil, NewError(E_NOTIMPL) 68 } 69 70 // CLSIDFromString retrieves Class ID from string representation. 71 // 72 // This is technically the string version of the GUID and will convert the 73 // string to object. 74 // 75 // CLSIDFromString in Windows API. 76 func CLSIDFromString(str string) (*GUID, error) { 77 return nil, NewError(E_NOTIMPL) 78 } 79 80 // StringFromCLSID returns GUID formated string from GUID object. 81 func StringFromCLSID(clsid *GUID) (string, error) { 82 return "", NewError(E_NOTIMPL) 83 } 84 85 // IIDFromString returns GUID from program ID. 86 func IIDFromString(progId string) (*GUID, error) { 87 return nil, NewError(E_NOTIMPL) 88 } 89 90 // StringFromIID returns GUID formatted string from GUID object. 91 func StringFromIID(iid *GUID) (string, error) { 92 return "", NewError(E_NOTIMPL) 93 } 94 95 // CreateInstance of single uninitialized object with GUID. 96 func CreateInstance(clsid *GUID, iid *GUID) (*IUnknown, error) { 97 return nil, NewError(E_NOTIMPL) 98 } 99 100 // GetActiveObject retrieves pointer to active object. 101 func GetActiveObject(clsid *GUID, iid *GUID) (*IUnknown, error) { 102 return nil, NewError(E_NOTIMPL) 103 } 104 105 // VariantInit initializes variant. 106 func VariantInit(v *VARIANT) error { 107 return NewError(E_NOTIMPL) 108 } 109 110 // VariantClear clears value in Variant settings to VT_EMPTY. 111 func VariantClear(v *VARIANT) error { 112 return NewError(E_NOTIMPL) 113 } 114 115 // SysAllocString allocates memory for string and copies string into memory. 116 func SysAllocString(v string) *int16 { 117 u := int16(0) 118 return &u 119 } 120 121 // SysAllocStringLen copies up to length of given string returning pointer. 122 func SysAllocStringLen(v string) *int16 { 123 u := int16(0) 124 return &u 125 } 126 127 // SysFreeString frees string system memory. This must be called with SysAllocString. 128 func SysFreeString(v *int16) error { 129 return NewError(E_NOTIMPL) 130 } 131 132 // SysStringLen is the length of the system allocated string. 133 func SysStringLen(v *int16) uint32 { 134 return uint32(0) 135 } 136 137 // CreateStdDispatch provides default IDispatch implementation for IUnknown. 138 // 139 // This handles default IDispatch implementation for objects. It haves a few 140 // limitations with only supporting one language. It will also only return 141 // default exception codes. 142 func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (*IDispatch, error) { 143 return nil, NewError(E_NOTIMPL) 144 } 145 146 // CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch. 147 // 148 // This will not handle the full implementation of the interface. 149 func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error) { 150 return nil, NewError(E_NOTIMPL) 151 } 152 153 // copyMemory moves location of a block of memory. 154 func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {} 155 156 // GetUserDefaultLCID retrieves current user default locale. 157 func GetUserDefaultLCID() uint32 { 158 return uint32(0) 159 } 160 161 // GetMessage in message queue from runtime. 162 // 163 // This function appears to block. PeekMessage does not block. 164 func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error) { 165 return int32(0), NewError(E_NOTIMPL) 166 } 167 168 // DispatchMessage to window procedure. 169 func DispatchMessage(msg *Msg) int32 { 170 return int32(0) 171 } 172 173 func GetVariantDate(value uint64) (time.Time, error) { 174 return time.Now(), NewError(E_NOTIMPL) 175 }