Questions tagged [lpbyte]

10 questions
2
votes
2 answers

C++ Compiler errors after changing LPBYTE to unsigned char* in Win DLL to Linux SO conversion

I am working on converting a Windows DLL to a Linux SO. I have converted all of the types BYTE to unsigned char and LPBYTE to unsigned char*. The compiler is giving me errors in one function as follows: Error: Invalid Conversion from 'char*' to…
Cosworth66
  • 597
  • 5
  • 14
2
votes
1 answer

Converting LPBYTE into String

I'm querying data from the registry and it's being outputted as LPBYTE, and this is where i'm stuck. I need to convert the LPBYTE into a type of data that I can manipulate such as a String. This is my code so far HKEY hk; string poolID; DWORD dwSize…
Ryan
  • 957
  • 5
  • 16
  • 34
1
vote
3 answers

How to pass an array of bytes as a Pointer in C#

I have two questions.They both are concerning a void in C++,which I am trying to translate in C#. C++ code void Func_X_2(LPBYTE stream, DWORD key, BYTE keyByte) { stream[0] ^= (stream[0] + LOBYTE(LOWORD(key)) + keyByte); stream[1] ^= (stream[1] +…
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
1
vote
4 answers

C# calling unmanaged code

I am trying to call unmanaged code using C#. extern "C" __declspec(dllexport) LPBYTE DataReceived(LPBYTE signals) { LPBYTE test; *(WORD*)(test) = 0x0C; *(WORD*)(test + 2) = 0x1000; return test; // I even tried returning 0x00 only;…
unmanageddude
  • 13
  • 1
  • 3
1
vote
3 answers

How to easy convert LPBYTE to char[256] (used to read text from windows registry)

How I can convert LPBYTE to char [256]? When I read from Windows registry value: blah REG_SZ "blah some text" char value[256]; DWORD keytype = REG_SZ; DWORD dwCount = sizeof(value); RegQueryValueEx((HKEY)key, "blah", 0, &keytype, (LPBYTE)&value,…
Lisa25
0
votes
2 answers

How to iterate through each byte of an LPBYTE in C++

Excuse the simplicity of my question, I'm not used to working with Windows types. I have an LPBYTE buffer and i wish to XOR each byte of it with another byte. What is the proper way of getting the length of the buffer and iterating through it in…
Dave White
  • 321
  • 1
  • 3
  • 13
0
votes
1 answer

How to convert LPBYTE to string

LPBYTE buffer = (LPBYTE)calloc(1024, sizeof(char)); std::string res; I want something like: res = buffer;
sandro98
  • 29
  • 6
0
votes
3 answers

How to call a function in an unmanaged dll from C# Code?

How can I call the following method from C#, which is in a C++ dll? How Can I recreate the following structure in C#? Original Method: LONG MyMethod (P_HOLO_INFO pInfo, LPVOID pBuffer, LPUSHORT pTracksWritten); Structure: This method uses the…
aWebdesigner09
  • 257
  • 2
  • 5
  • 17
0
votes
2 answers

How to convert LPBYTE to char */string in C++?

How do I convert LPBYTE into char * or string? Specifically, I am calling EnumPrinterDataEx(), and taking the pData out of it, and want to convert that. When I try to convert using wcstombs(), it only gives the first character from the pData. But I…
NV Bhargava
  • 373
  • 2
  • 10
-2
votes
1 answer

Struggling with conversion of an LPBYTE to char* or anything alike in C (Chinese output?)

I've got a C project that I'm working on and I'm having a problem. The program reads a string that is echoed by a .php page. It uses this code to read the data and appoint it to a variable, which get sent to the Commands() function: LPSTR…
Tsukirid
  • 33
  • 5