| 155 | return true; |
| 156 | } |
| 157 | bool 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 | |
| 183 | bool ITSDCardInfo(DWORD dwDiskNr, DWORD& dwBlockSize, DWORD& dwTotalBlocks) |
| 184 | { |
no test coverage detected