MCPcopy Create free account
hub / github.com/ariccio/altWinDirStat / ITWriteSDCard

Function ITWriteSDCard

Reference code/osImageTool/RemoteDevice.cpp:157–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 return true;
156}
157bool ITWriteSDCard(DWORD dwDiskNr, DWORD dwOffset, const BYTE *buffer, DWORD dwBufferSize, DWORD *pdwNumberOfBytesWritten)
158{
159 int insize= sizeof(WriteSDCardParams)+dwBufferSize;
160 WriteSDCardParams *inbuf= (WriteSDCardParams *)LocalAlloc(LPTR, insize);
161 DWORD outsize=0;
162 WriteSDCardResult *outbuf=NULL;
163
164 inbuf->dwDiskNr= dwDiskNr;
165 inbuf->dwOffset= dwOffset;
166 inbuf->dwSize= dwBufferSize;
167 memcpy(inbuf->buffer, buffer, dwBufferSize);
168
169 HRESULT res= CeRapiInvoke(L"\\Windows\\ItsUtils.dll", L"ITWriteSDCard",
170 insize, (BYTE*)inbuf,
171 &outsize, (BYTE**)&outbuf, NULL, 0);
172 if (res)
173 {
174 g_err.Set(stringformat("ITWriteSDCard: %s", LastError(res).c_str()));
175 return false;
176 }
177 *pdwNumberOfBytesWritten= outbuf->dwNumberOfBytesWritten;
178 LocalFree(outbuf);
179
180 return true;
181}
182
183bool ITSDCardInfo(DWORD dwDiskNr, DWORD& dwBlockSize, DWORD& dwTotalBlocks)
184{

Callers 1

WriteDataMethod · 0.85

Calls 3

stringformatFunction · 0.85
LastErrorFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected