Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGroup policy editor api Pin
Member 1487268130-Aug-20 23:13
Member 1487268130-Aug-20 23:13 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 1:27
mveRichard MacCutchan31-Aug-20 1:27 
QuestionRe: Group policy editor api Pin
Member 1487268131-Aug-20 17:08
Member 1487268131-Aug-20 17:08 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 20:57
mveRichard MacCutchan31-Aug-20 20:57 
GeneralRe: Group policy editor api Pin
Member 1487268131-Aug-20 21:33
Member 1487268131-Aug-20 21:33 
GeneralRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 21:40
mveRichard MacCutchan31-Aug-20 21:40 
AnswerRe: Group policy editor api Pin
Randor 1-Sep-20 23:24
professional Randor 1-Sep-20 23:24 
QuestionWindows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 12:01
jackngill30-Aug-20 12:01 
To anyone who can help me Please?

I apologise in advance if my question seems confusing noobish but I have no clue about coding in C++ hence the apparent ignorance & difficulty to me (& for some it may be a very basic question). First of all I have these lines of code that I would like to amend slightly like so:
typedef DWORD(__stdcall *CPP) (DWORD param1, PWCHAR param2, DWORD param3);

void Disable_WFP() {
    hmod=LoadLibrary("sfc_os.dll");
    CPP SetSfcFileException;
    // the function is stored at the fifth ordinal in sfc_os.dll
    SetSfcFileException=(CPP)GetProcAddress(hmod,(LPCSTR)5);
    SetSfcFileException(0, L"c:\\windows\\system32\\calc.exe",-1);
    // Now we can modify the system file in a complete stealth.
}

It is not my code it belongs to Abdellatif_El_Khlifi & all credit belongs to him but I would like to make a small amendmant to his code but have no clue how to do this the alteration I would like to change this line:

SetSfcFileException(0, L"c:\\windows\\system32\\calc.exe",-1);

and alter to: (this is obviously not C++ but just trying to illustrate what I am trying to do)

SetSfcFileException(0, L"%SystemDrive%\\windows\\system32\\calc.exe",-1);

My question is there a equivelent C++ code for the SystemDrive variable & could someone re-code this to make the small amendmant Please to suit my needs? The reason is it will make the program more generic for me just in case say for instance my OS XP is installed on D:\\ drive instead of C:\\ drive. I have found this snippet of code that may be of help but have no clue as to how I would incorporate in the given scenario above. char *sysDrive = getenv ("SystemDrive"); or this
sysdrive = getenv("SYSTEMDRIVE");
    if (sysdrive == NULL || *sysdrive == NUL)
	sysdrive = "C:\\";
}

Best Regards,
Jackngill
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Mircea Neacsu30-Aug-20 16:47
Mircea Neacsu30-Aug-20 16:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 22:26
jackngill30-Aug-20 22:26 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill2-Sep-20 22:48
jackngill2-Sep-20 22:48 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 2:59
David Crow3-Sep-20 2:59 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 4:01
jackngill3-Sep-20 4:01 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 4:23
David Crow3-Sep-20 4:23 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 6:41
Victor Nijegorodov3-Sep-20 6:41 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:08
David Crow3-Sep-20 7:08 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
Victor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:57
David Crow3-Sep-20 7:57 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:04
Victor Nijegorodov3-Sep-20 8:04 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:09
David Crow3-Sep-20 8:09 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:27
Victor Nijegorodov3-Sep-20 9:27 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:07
Victor Nijegorodov3-Sep-20 8:07 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
Victor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 11:41
jackngill3-Sep-20 11:41 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 22:29
Victor Nijegorodov3-Sep-20 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.