FreeRDP
DataMessage.c
1 
20 #include <winpr/config.h>
21 
22 #include "wlog.h"
23 
24 #include "DataMessage.h"
25 
26 #include <winpr/file.h>
27 
28 #include "../../log.h"
29 #define TAG WINPR_TAG("utils.wlog")
30 
31 BOOL WLog_DataMessage_Write(const char* filename, const void* data, size_t length)
32 {
33  FILE* fp = NULL;
34  BOOL ret = TRUE;
35 
36  fp = winpr_fopen(filename, "w+b");
37 
38  if (!fp)
39  {
40  // WLog_ERR(TAG, "failed to open file %s", filename);
41  return FALSE;
42  }
43 
44  if (fwrite(data, length, 1, fp) != 1)
45  ret = FALSE;
46  (void)fclose(fp);
47  return ret;
48 }