| 104 | } |
| 105 | |
| 106 | STDMETHODIMP CSubRenderOptionsImpl::GetString(LPCSTR field, LPWSTR *value, int *chars) |
| 107 | { |
| 108 | GET_OPT_AND_VALIDATE(SROPT_TYPE_STRING) |
| 109 | CheckPointer(chars, E_POINTER); |
| 110 | |
| 111 | const LPWSTR string = *(LPWSTR *)(((uint8_t *)context) + o->offset); |
| 112 | if (!string) |
| 113 | { |
| 114 | *value = nullptr; |
| 115 | *chars = 0; |
| 116 | return S_OK; |
| 117 | } |
| 118 | |
| 119 | *chars = (int)wcslen(string); |
| 120 | *value = (LPWSTR)LocalAlloc(0, sizeof(WCHAR) * (*chars + 1)); |
| 121 | CheckPointer(*value, E_OUTOFMEMORY); |
| 122 | wcscpy_s(*value, *chars + 1, string); |
| 123 | |
| 124 | return S_OK; |
| 125 | } |
| 126 | |
| 127 | STDMETHODIMP CSubRenderOptionsImpl::GetBin(LPCSTR field, LPVOID *value, int *size) |
| 128 | { |