Jump to content

Dietmar

Member
  • Posts

    1,429
  • Joined

  • Last visited

  • Days Won

    5
  • Donations

    0.00 USD 
  • Country

    Germany

Everything posted by Dietmar

  1. Hi, I ask chatGPT, to find the Extremum of f(x) = 4000*x*E^(-0.4*x) Oh, interesting, it founds after loong search x=5 which is wrong, because it is x=2.5 brrr.. And with this program students in USA learn to be medics. Soon, from 10% of people in world, who understand something, the use of stupids like chatgpt will lead fast to less than 1% understand anything, happy future is coming Dietmar EDIT: Oha, after I tell chatGPT, that x=5 is wrong, I get this answer: You are correct that x=5 is not a valid solution, my apologies for the mistake. Therefore, the only valid solution for the critical point is x = 2.5 and it is a local maximum. Again, I apologize for any confusion caused by my previous response. EDIT2: I: Still you are wrong with "as the function is defined for x > 0" chatGPT: I apologize for the confusion, you are correct that the function is defined for all real numbers x, not just x > 0.
  2. I make some more tests: With this Java Program, build just now with Netbeans 16 and JRE 1.8.0_151 also the via www.jar2exe.com build pong.exe runs only in an Java Environment. So, Launch4j-3.8-win32.exe is the better choice, because it is free. I do not succeed to make a pong.exe Program without any Java Environment but under Java 1.8.0 Environment it works Dietmar Here is all: Source, pong.jar, pong.exe https://ufile.io/os4ynlxq package pong; import java.awt.Color; import java.awt.Graphics; import javax.swing.JFrame; import javax.swing.JPanel; public class Pong extends JPanel { int x = 0, y = 0, xa = 1, ya = 1; private void moveBall() { x = x + xa; y = y + ya; if (x + xa > getWidth() - 30 || x + xa < 0) xa = -xa; if (y + ya > getHeight() - 30 || y + ya < 0) ya = -ya; } @Override public void paint(Graphics g) { super.paint(g); g.setColor(Color.RED); g.fillOval(x, y, 30, 30); } public static void main(String[] args) throws InterruptedException { JFrame frame = new JFrame("Pong"); Pong game = new Pong(); frame.add(game); frame.setSize(300, 400); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); while (true) { game.moveBall(); game.repaint(); Thread.sleep(10); } } }
  3. After crazy a lot of tests I get it to run with the program jar2exe as console application. Now it runs also on XP SP3. Homepage is www.jar2exe.com . I build it with Netbeans 16 Ant on java 1.8.0_151 . The size of the prim.exe program is about 180 KB, but it runs on any windows without any Java. Only for to build you have to convert the Prim.jar ==> prim.exe on the compi with your Netbeans, where this Prim.jar is build. The error in all the other programs is, that the Main Class (here with name prim.Prim) cant be found. Strange, Main Class is there as prim.Prim . Dietmar EDIT: I succeed also with Launch4j-3.8-win32.exe For this, you have to give under Netbeans a Main Class for example prim.Prim . But under Launch4j-3.8 you leave the Main Class unchecked, crazy. E:\>prim.exe Bis zu welcher Zahl möchten Sie die Primzahlen berechnen? : 100 Die Primzahlen bis 100 sind: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 E:\>
  4. @D.Draker I tried a lot. A lot of prim.exe where build. No one works Dietmar PS: May be, here in the forum is somebody, who can make an prim.exe from my Prim.jar file, build with Netbeans 16 Ant under XP SP3 Dietmar Here is my Prim.jar file https://ufile.io/l9xn8794
  5. @loblolly986 I tried JSmooth. Dont know, how to use it. I get message "Error, compiler couldn't be created. Error description should follow: - Selected skeleton is unknown." Dietmar
  6. Hi, I test some programs for to convert an Java file *.jar to *.exe for school. This Java file Prim.jar is build with Netbeans 16 Ant under XP SP3 and works nice in this Netbeans 16 IDE under XP via Java 1.8.0_151 version. This new converted prim.exe program should run under XP SP3, Vista, win7, win8.1, win10, win11. Most convert programs do not work under XP SP3. When you run it as a Console Application for example this program prim.exe, which generates Prim Numbers, after finishing always closed the console at once, brrr.. Dietmar EDIT: Is there any possibility, to make an prim.exe , that runs without any Java Environment? For me it is strange as much as possible. When you build an prim.exe via C language, all those problems never happen. Here is my file Prim.jar https://ufile.io/l9xn8794 package prim; import java.util.Scanner; public class Prim { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Bis zu welcher Zahl möchten Sie die Primzahlen berechnen? : "); int n = scanner.nextInt(); System.out.println("Die Primzahlen bis " + n + " sind:"); for (int i = 2; i <= n; i++) { if (isPrimeNumber(i)) { System.out.print(i + " "); } } } public static boolean isPrimeNumber(int number) { if (number < 2) { return false; } for (int i = 2; i <= Math.sqrt(number); i++) { if (number % i == 0) { return false; } } return true; } }
  7. @George King @Mov AX, 0xDEAD does not want, that I make online the new compiled acpi.sys for XP SP3 as a single file. So I modd my Sources for myself and you have to compile it for yourself. This is the whole folder acpi from the Sources with all updates as today 19 January 2023 Dietmar https://ufile.io/cz9x60n2 EDIT: For XP SP2 bit64, the new patch is to 100% identic as for XP SP3 bit32.
  8. @Dave-H @George King It is not the last acpi.sys for XP SP3. After crazy search for the Bsod in XP SP2 bit64 @Mov AX, 0xDEAD found the error. This error is a global error, it may happen in other Win OS also. Only one SSDT table is loaded (when time is short during boot) with more than 2 processors. @Mov AX, 0xDEAD takes a deeper look into this and may be the wrong header for ntoskrnl.exe in XP SP2 bit64 is the real reason. I dont know more. I compiled this updated Source Files for XP SP3 and also for XP SP2 bit64. The error is gone. The boottime for XP SP2 bit64 is now much shorter, about half the time as before with this new acpi.sys. On XP SP3 the boottime is the same. So, may be, that the last patch for XP SP2 bit64 will be also transfered to XP SP3 acpi.sys. We just need to wait a little for news Dietmar
  9. My Email program Outlook Express under XP SP3 just crashes, not possible to get or send any mails. After some searching I get it to work again: 1.) Install the Posready Patch for TSL1.2 2.) Put this to your registry and at once, without restart of compi Outlook Express works Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\CRYPTO\TLS1.1] "OSVersion"="3.5.1.0.0" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\CRYPTO\TLS1.2] "OSVersion"="3.5.1.0.0" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000 Oha, now I get more than 8000 mails. Seems, that I miss already some for now about 1 year, even I had the Posready TLS1.2 patch installed Dietmar
  10. @pappyN4 I think, it is a problem of shared IRQ lines, bad managment on the board itself. Hardware problem, as you already think about. I have a similar problem with an AMD Asrock fatal1ty AB350 gaming K4 board with Ryzen 1700x or 3700x cpu. Only sound or lan (both integrated on board), not possible both together under XP SP3. Even I also succeed to integrate an working DSDT table from other compi to registry via asl.exe, this crazy behavior stays. On later Bios for this board they "solved" this problem but the whole board becomes unstable Dietmar
  11. @pappyN4 The XP SP2 bit64 intelppm.sys is a little bit different than its XP SP3 counterpart. But the idea is just the same: Fake all the C3 and C2 states to go to C1 AcpiC3ArbdisIdle ==> AcpiC1Idle and AcpiC2Idle ==> AcpiC1Idle By the way: Does your Ida Pro version allows you to write back the open and edited file back to its original? I mean, do you have in your Ida Pro Edit-->Patch Program->Apply patches to input file I have 6.1 version, there this possibility not exist and you have to write back your changes all by hand Dietmar
  12. @UsefulAGKHelper Make a try with integrating my time delayed acpi.sys bit64 for XP SP2 and report Dietmar https://ufile.io/b1e6d45s
  13. @Andalu Make a try with all Security and TPM devices disabled in Bios. Set OS to "Other OS", disable Fast Boot. Make a try with an original XP SP3 *.iso. With the Ramsey XP I noticed sometimes also a strange boot delay, but may be about 10 sec. Make try with the Kai Sata and no nvme, no USB, only basic drivers, no changes in ntoskrnl.exe. When this behavior already in GUI Setup of XP happens, it can be detected as "bad" driver Dietmar
  14. @Andalu The boottime of XP SP3 is on all of my 4 different z690 boards via WD 2TB harddisk 25 sec, also with different acpi.sys (v6, v7, v8), and 9 sec from nvme Dietmar
  15. @Mov AX, 0xDEAD Very interesting, what the header structure tells in this very last update of XP SP2 bit 64 Dietmar
  16. @Mov AX, 0xDEAD Does the Bsod 0xC0000034 with the HIDD device in XP SP2 bit64 and load only one SSDT table instead of all, belongs to this Dietmar PS: I just compare the ke.h from Sources for XP SP1 with the ke.h of the Win2k3 Sources. There are differences.
  17. Hi, what does this mean for the acpi.sys for x64 SP2 and can I help you with testing Dietmar
  18. And here is the patch for intelppm.sys version 5.2.3790.4143 (srv03_sp2_qfe.070831-1432) Modd vs original 128: CC 4E 129: 7B FC 12A: 01 00 65F2: 4A 8A 65F9: 43 03 65FA: A1 A2 7C1E: 1E 5E 7CD3: 69 29 7CD4: 8A 8B Dietmar
  19. Here is the patch for hal.dll 5.2.3790.6912 (srv03_sp2_qfe.190711-0601) XP SP2 bit64 , which solves the timer problem Modd vs original 138: 2C B4 139: F3 7A 38881: EB 73 40186: EB 73
  20. There are even more good news about XP SP2 bit 64. Now we have brandnew acpi.sys, intelppm.sys and hal.dll. The timer problem is gone, the big powerconsumption from 54 watt ==> 1.6 Watt on 0% load and the crazy Bsod C0000034, which needs hard work as much as possible with interpreting results of Windbg over COM1 connection Dietmar
  21. @Damnation I think, that the crazy 149C controller sits on the cpu chip itself. On my boards, the onboard 149C work always, but not those in cpu chip. I see the strange behavior, that with one Ryzen Model the 149C on chip works and with other shows nearly the same symptoms as yours. What you can do is, to compare the DSDTs of both motherboards, if the USB is declared different. But I think, it is a really crazy AMD cpu problem Dietmar PS: Intel has the Timer Problem and the Big Powerconsumption on newer boards.
  22. I just get confirmation, that the delay acpi.sys for XP SP2 bit64 works also on z790 boards Dietmar
  23. @Damnation Hi, I just build for you the same delay acpi.sys for XP SP3, free version. Dont know, if it will work. What it is doing is, to slow down the boot phase of XP for any important method, so it has for sure an effect but dont know, if this USB bug is time related. In any case, in 10 years we will need it Dietmar https://ufile.io/2vfhm7ze
  24. @Mov AX, 0xDEAD Delay method works, just a little bit more extendet on all methods before Bsod, boottime 50sec of XP SP2 bit 64. I test with success on all of my z690 boards. Here is free acpi.sys for XP SP2 bit 64. The file acpins.c is the only file, that needs to be modded. https://ufile.io/b1e6d45s Dietmar /*** acpins.c - ACPI Name Space functions * * Copyright (c) 1996,1997 Microsoft Corporation * Author: Michael Tsang (MikeTs) * Created 09/09/96 * * MODIFICATION HISTORY */ #include "pch.h" #ifdef LOCKABLE_PRAGMA #pragma ACPI_LOCKABLE_DATA #pragma ACPI_LOCKABLE_CODE #endif /***LP GetNameSpaceObject - Find a name space object * * ENTRY * pszObjPath -> object path string * pnsScope - object scope to start the search (NULL means root) * ppnsObj -> to hold the object found * dwfNS - flags * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL GetNameSpaceObject(PSZ pszObjPath, PNSOBJ pnsScope, PPNSOBJ ppns, ULONG dwfNS) { TRACENAME("GETNAMESPACEOBJECT") NTSTATUS rc = STATUS_SUCCESS; PSZ psz; LONG delay = 10; // microseconds KIRQL irql = KeGetCurrentIrql(); ENTER(3, ("GetNameSpaceObject(ObjPath=%s,Scope=%s,ppns=%x,Flags=%x)\n", pszObjPath, GetObjectPath(pnsScope), ppns, dwfNS)); if (pnsScope == NULL) pnsScope = gpnsNameSpaceRoot; if (*pszObjPath == '\\') { psz = &pszObjPath[1]; pnsScope = gpnsNameSpaceRoot; } else { psz = pszObjPath; while ((*psz == '^') && (pnsScope != NULL)) { psz++; pnsScope = pnsScope->pnsParent; } } *ppns = pnsScope; if (pnsScope == NULL) { DbgPrint("C0000034 #13 \n"); rc = AMLIERR_OBJ_NOT_FOUND; } else if (*psz != '\0') { BOOLEAN fSearchUp; PNSOBJ pns; fSearchUp = (BOOLEAN)(!(dwfNS & NSF_LOCAL_SCOPE) && (pszObjPath[0] != '\\') && (pszObjPath[0] != '^') && (STRLEN(pszObjPath) <= sizeof(NAMESEG))); for (;;) { do { if ((pns = pnsScope->pnsFirstChild) == NULL) { DbgPrint("C0000034 #14 \n"); if ( (pszObjPath[0] == '_' && pszObjPath[1] == 'H' && // _HID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'U' && // _UID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STA pszObjPath[2] == 'T' && pszObjPath[3] == 'A') || (pszObjPath[0] == '_' && pszObjPath[1] == 'P' && // _PRW pszObjPath[2] == 'R' && pszObjPath[3] == 'W') || (pszObjPath[0] == '_' && pszObjPath[1] == 'A' && // _ADR pszObjPath[2] == 'D' && pszObjPath[3] == 'R') || (pszObjPath[0] == '_' && pszObjPath[1] == 'C' && // _CID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'I' && // _INI pszObjPath[2] == 'N' && pszObjPath[3] == 'I') || (pszObjPath[0] == '_' && pszObjPath[1] == 'B' && // _BBN pszObjPath[2] == 'B' && pszObjPath[3] == 'N') || (pszObjPath[0] == '_' && pszObjPath[1] == 'C' && // _CRS pszObjPath[2] == 'R' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DIS pszObjPath[2] == 'I' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _SRS pszObjPath[2] == 'R' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DDN pszObjPath[2] == 'D' && pszObjPath[3] == 'N') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DSD pszObjPath[2] == 'S' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'W' && // _WDG pszObjPath[2] == 'D' && pszObjPath[3] == 'G') || (pszObjPath[0] == '_' && pszObjPath[1] == 'P' && // _PLD pszObjPath[2] == 'L' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DEP pszObjPath[2] == 'E' && pszObjPath[3] == 'P') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _S0W pszObjPath[2] == '0' && pszObjPath[3] == 'W') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STR pszObjPath[2] == 'T' && pszObjPath[3] == 'R') || (pszObjPath[0] == '_' && pszObjPath[1] == 'W' && // _WED pszObjPath[2] == 'E' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'T' && // _T_0 pszObjPath[2] == '_' && pszObjPath[3] == '0') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STR pszObjPath[2] == 'T' && pszObjPath[3] == 'R') ){ if (irql < DISPATCH_LEVEL) { LARGE_INTEGER timeoutPeriod; timeoutPeriod.QuadPart = -10 * delay; // units of 100ns -> microseconds KeDelayExecutionThread(KernelMode, FALSE, &timeoutPeriod ); } else { KeStallExecutionProcessor((ULONG)delay); } } DbgPrint("ObjPath=%s,Scope=%s, psz=%s \n", pszObjPath, GetObjectPath(pnsScope), psz); rc = AMLIERR_OBJ_NOT_FOUND; } else { BOOLEAN fFound; PSZ pszEnd; ULONG dwLen; NAMESEG dwName; if ((pszEnd = STRCHR(psz, '.')) != NULL) dwLen = (ULONG)(pszEnd - psz); else dwLen = STRLEN(psz); if (dwLen > sizeof(NAMESEG)) { rc = AMLI_LOGERR(AMLIERR_INVALID_NAME, ("GetNameSpaceObject: invalid name - %s", pszObjPath)); // Satisfy the compiler... fFound = FALSE; } else { dwName = NAMESEG_BLANK; MEMCPY(&dwName, psz, dwLen); // // Search all siblings for a matching NameSeg. // fFound = FALSE; do { if (pns->dwNameSeg == dwName) { pnsScope = pns; fFound = TRUE; break; } pns = (PNSOBJ)pns->list.plistNext; } while (pns != pns->pnsParent->pnsFirstChild); } if (rc == STATUS_SUCCESS) { if (!fFound) { DbgPrint("C0000034 #15 \n"); if ( (pszObjPath[0] == '_' && pszObjPath[1] == 'H' && // _HID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'U' && // _UID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STA pszObjPath[2] == 'T' && pszObjPath[3] == 'A') || (pszObjPath[0] == '_' && pszObjPath[1] == 'P' && // _PRW pszObjPath[2] == 'R' && pszObjPath[3] == 'W') || (pszObjPath[0] == '_' && pszObjPath[1] == 'A' && // _ADR pszObjPath[2] == 'D' && pszObjPath[3] == 'R') || (pszObjPath[0] == '_' && pszObjPath[1] == 'C' && // _CID pszObjPath[2] == 'I' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'I' && // _INI pszObjPath[2] == 'N' && pszObjPath[3] == 'I') || (pszObjPath[0] == '_' && pszObjPath[1] == 'B' && // _BBN pszObjPath[2] == 'B' && pszObjPath[3] == 'N') || (pszObjPath[0] == '_' && pszObjPath[1] == 'C' && // _CRS pszObjPath[2] == 'R' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DIS pszObjPath[2] == 'I' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _SRS pszObjPath[2] == 'R' && pszObjPath[3] == 'S') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DDN pszObjPath[2] == 'D' && pszObjPath[3] == 'N') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DSD pszObjPath[2] == 'S' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'W' && // _WDG pszObjPath[2] == 'D' && pszObjPath[3] == 'G') || (pszObjPath[0] == '_' && pszObjPath[1] == 'P' && // _PLD pszObjPath[2] == 'L' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'D' && // _DEP pszObjPath[2] == 'E' && pszObjPath[3] == 'P') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _S0W pszObjPath[2] == '0' && pszObjPath[3] == 'W') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STR pszObjPath[2] == 'T' && pszObjPath[3] == 'R') || (pszObjPath[0] == '_' && pszObjPath[1] == 'W' && // _WED pszObjPath[2] == 'E' && pszObjPath[3] == 'D') || (pszObjPath[0] == '_' && pszObjPath[1] == 'T' && // _T_0 pszObjPath[2] == '_' && pszObjPath[3] == '0') || (pszObjPath[0] == '_' && pszObjPath[1] == 'S' && // _STR pszObjPath[2] == 'T' && pszObjPath[3] == 'R') ) { if (irql < DISPATCH_LEVEL) { LARGE_INTEGER timeoutPeriod; timeoutPeriod.QuadPart = -10 * delay; // units of 100ns -> microseconds KeDelayExecutionThread(KernelMode, FALSE, &timeoutPeriod ); } else { KeStallExecutionProcessor((ULONG)delay); } } DbgPrint("ObjPath=%s,Scope=%s, psz=%s \n", pszObjPath, GetObjectPath(pnsScope), psz); rc = AMLIERR_OBJ_NOT_FOUND; } else { psz += dwLen; if (*psz == '.') { psz++; } else if (*psz == '\0') { *ppns = pnsScope; break; } } } } } while (rc == STATUS_SUCCESS); if ((rc == AMLIERR_OBJ_NOT_FOUND) && fSearchUp && (pnsScope != NULL) && (pnsScope->pnsParent != NULL)) { pnsScope = pnsScope->pnsParent; rc = STATUS_SUCCESS; } else { break; } } } if ((dwfNS & NSF_WARN_NOTFOUND) && (rc == AMLIERR_OBJ_NOT_FOUND)) { rc = AMLI_LOGERR(rc, ("GetNameSpaceObject: object %s not found", pszObjPath)); } if (rc != STATUS_SUCCESS) { *ppns = NULL; } EXIT(3, ("GetNameSpaceObject=%x (pns=%x)\n", rc, *ppns)); return rc; } //GetNameSpaceObject /***LP CreateNameSpaceObject - Create a name space object under current scope * * ENTRY * pheap -> HEAP * pszName -> name string of the object (NULL if creating noname object) * pnsScope - scope to create object under (NULL means root) * powner -> object owner * ppns -> to hold the pointer to the new object (can be NULL) * dwfNS - flags * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL CreateNameSpaceObject(PHEAP pheap, PSZ pszName, PNSOBJ pnsScope, POBJOWNER powner, PPNSOBJ ppns, ULONG dwfNS) { TRACENAME("CREATENAMESPACEOBJECT") NTSTATUS rc = STATUS_SUCCESS; PNSOBJ pns = NULL; ENTER(3, ("CreateNameSpaceObject(pheap=%x,Name=%s,pnsScope=%x,powner=%x,ppns=%x,Flags=%x)\n", pheap, pszName? pszName: "<null>", pnsScope, powner, ppns, dwfNS)); if (pnsScope == NULL) pnsScope = gpnsNameSpaceRoot; if (pszName == NULL) { if ((pns = NEWNSOBJ(pheap, sizeof(NSOBJ))) == NULL) { rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("CreateNameSpaceObject: fail to allocate name space object")); } else { ASSERT(gpnsNameSpaceRoot != NULL); MEMZERO(pns, sizeof(NSOBJ)); pns->pnsParent = pnsScope; InsertOwnerObjList(powner, pns); ListInsertTail(&pns->list, (PPLIST)&pnsScope->pnsFirstChild); } } else if ((*pszName != '\0') && ((rc = GetNameSpaceObject(pszName, pnsScope, &pns, NSF_LOCAL_SCOPE)) == STATUS_SUCCESS)) { if (!(dwfNS & NSF_EXIST_OK)) { rc = AMLI_LOGERR(AMLIERR_OBJ_ALREADY_EXIST, ("CreateNameSpaceObject: object already exist - %s", pszName)); } } else if ((*pszName == '\0') || (rc == AMLIERR_OBJ_NOT_FOUND)) { rc = STATUS_SUCCESS; // // Are we creating root? // if (STRCMP(pszName, "\\") == 0) { ASSERT(gpnsNameSpaceRoot == NULL); ASSERT(powner == NULL); if ((pns = NEWNSOBJ(pheap, sizeof(NSOBJ))) == NULL) { rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("CreateNameSpaceObject: fail to allocate name space object")); } else { MEMZERO(pns, sizeof(NSOBJ)); pns->dwNameSeg = NAMESEG_ROOT; gpnsNameSpaceRoot = pns; InsertOwnerObjList(powner, pns); } } else { PSZ psz; PNSOBJ pnsParent; if ((psz = STRRCHR(pszName, '.')) != NULL) { *psz = '\0'; psz++; rc = GetNameSpaceObject(pszName, pnsScope, &pnsParent, NSF_LOCAL_SCOPE | NSF_WARN_NOTFOUND); } else if (*pszName == '\\') { psz = &pszName[1]; // // By this time, we'd better created root already. // ASSERT(gpnsNameSpaceRoot != NULL); pnsParent = gpnsNameSpaceRoot; } else if (*pszName == '^') { psz = pszName; pnsParent = pnsScope; while ((*psz == '^') && (pnsParent != NULL)) { pnsParent = pnsParent->pnsParent; psz++; } } else { ASSERT(pnsScope != NULL); psz = pszName; pnsParent = pnsScope; } if (rc == STATUS_SUCCESS) { int iLen = STRLEN(psz); if ((*psz != '\0') && (iLen > sizeof(NAMESEG))) { rc = AMLI_LOGERR(AMLIERR_INVALID_NAME, ("CreateNameSpaceObject: invalid name - %s", psz)); } else if ((pns = NEWNSOBJ(pheap, sizeof(NSOBJ))) == NULL) { rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("CreateNameSpaceObject: fail to allocate name space object")); } else { MEMZERO(pns, sizeof(NSOBJ)); if (*pszName == '\0') pns->dwNameSeg = NAMESEG_NONE; else { pns->dwNameSeg = NAMESEG_BLANK; MEMCPY(&pns->dwNameSeg, psz, iLen); } pns->pnsParent = pnsParent; InsertOwnerObjList(powner, pns); ListInsertTail(&pns->list, (PPLIST)&pnsParent->pnsFirstChild); } } } } if ((rc == STATUS_SUCCESS) && (ppns != NULL)) *ppns = pns; EXIT(3, ("CreateNameSpaceObject=%x (pns=%x)\n", rc, pns)); return rc; } //CreateNameSpaceObject /***LP FreeNameSpaceObjects - Free Name Space object and its children * * ENTRY * pnsObj -> name space object * * EXIT * None */ VOID LOCAL FreeNameSpaceObjects(PNSOBJ pnsObj) { TRACENAME("FREENAMESPACEOBJECTS") PNSOBJ pns, pnsSibling, pnsParent; #ifdef DEBUGGER POBJSYM pos; #endif ENTER(3, ("FreeNameSpaceObjects(Obj=%s)\n", GetObjectPath(pnsObj))); ASSERT(pnsObj != NULL); for (pns = pnsObj; pns != NULL;) { while (pns->pnsFirstChild != NULL) { pns = pns->pnsFirstChild; } pnsSibling = NSGETNEXTSIBLING(pns); pnsParent = NSGETPARENT(pns); ENTER(4, ("FreeNSObj(Obj=%s)\n", GetObjectPath(pns))); #ifdef DEBUGGER // // If I am in the symbol list, get rid of it before I die. // for (pos = gDebugger.posSymbolList; pos != NULL; pos = pos->posNext) { if (pns == pos->pnsObj) { if (pos->posPrev != NULL) pos->posPrev->posNext = pos->posNext; if (pos->posNext != NULL) pos->posNext->posPrev = pos->posPrev; if (pos == gDebugger.posSymbolList) gDebugger.posSymbolList = pos->posNext; FREESYOBJ(pos); break; } } #endif // // All my children are gone, I must die now. // ASSERT(pns->pnsFirstChild == NULL); if ((pns->ObjData.dwDataType == OBJTYPE_OPREGION) && (((POPREGIONOBJ)pns->ObjData.pbDataBuff)->bRegionSpace == REGSPACE_MEM)) { ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); if(((POPREGIONOBJ)pns->ObjData.pbDataBuff)->dwLen) { MmUnmapIoSpace((PVOID) ((POPREGIONOBJ)pns->ObjData.pbDataBuff)->uipOffset, ((POPREGIONOBJ)pns->ObjData.pbDataBuff)->dwLen); } } if (pns->pnsParent == NULL) { // // I am root! // ASSERT(pns == gpnsNameSpaceRoot); gpnsNameSpaceRoot = NULL; } else { ListRemoveEntry(&pns->list, (PPLIST)&pns->pnsParent->pnsFirstChild); } // // Free any attached data buffer if any // FreeDataBuffs(&pns->ObjData, 1); // // Free myself // if (pns->dwRefCount == 0) { FREENSOBJ(pns); } else { pns->ObjData.dwfData |= DATAF_NSOBJ_DEFUNC; ListInsertTail(&pns->list, &gplistDefuncNSObjs); } EXIT(4, ("FreeNSObj!\n")); if (pns == pnsObj) { // // I was the last one, done! // pns = NULL; } else if (pnsSibling != NULL) { // // I have siblings, go kill them. // pns = pnsSibling; } else { ASSERT(pnsParent != NULL); pns = pnsParent; } } EXIT(3, ("FreeNameSpaceObjects!\n")); } //FreeNameSpaceObjects /***LP LoadDDB - Load and parse Differentiated Definition Block * * ENTRY * pctxt -> CTXT * pdsdt -> DSDT block * pnsScope -> current scope * ppowner -> to hold new object owner * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL LoadDDB( PCTXT pctxt, PDSDT pdsdt, PNSOBJ pnsScope, POBJOWNER *ppowner ) { BOOLEAN freeTable = FALSE; NTSTATUS rc = STATUS_SUCCESS; if (!ValidateTable(pdsdt)) { rc = AMLI_LOGERR( AMLIERR_INVALID_TABLE, ("LoadDDB: invalid table %s at 0x%08x", NameSegString(pdsdt->Header.Signature), pdsdt) ); freeTable = TRUE; } else { rc = NewObjOwner( gpheapGlobal, ppowner); if (rc == STATUS_SUCCESS) { if (pctxt->pcall == NULL) { rc = PushCall(pctxt, NULL, &pctxt->Result); } if (rc == STATUS_SUCCESS) { #ifdef DEBUGGER gDebugger.pbBlkBegin = pdsdt->DiffDefBlock; gDebugger.pbBlkEnd = (PUCHAR)pdsdt + pdsdt->Header.Length; #endif rc = PushScope( pctxt, pdsdt->DiffDefBlock, (PUCHAR)pdsdt + pdsdt->Header.Length, pctxt->pbOp, pnsScope, *ppowner, gpheapGlobal, &pctxt->Result ); } } else { freeTable = TRUE; } } if (freeTable) { pctxt->powner = NULL; FreeContext(pctxt); } return rc; } //LoadDDB /***LP LoadMemDDB - Load DDB from physical memory * * ENTRY * pctxt -> CTXT * pDDB -> beginning of DDB * ppowner -> to hold owner handle * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL LoadMemDDB(PCTXT pctxt, PDSDT pDDB, POBJOWNER *ppowner) { TRACENAME("LOADMEMDDB") NTSTATUS rc = STATUS_SUCCESS; ENTER(3, ("LoadMemDDB(pctxt=%x,Addr=%x,ppowner=%x)\n", pctxt, pDDB, ppowner)); if ((ghValidateTable.pfnHandler != NULL) && ((rc = ((PFNVT)ghValidateTable.pfnHandler)(pDDB, ghValidateTable.uipParam)) != STATUS_SUCCESS)) { rc = AMLI_LOGERR(AMLIERR_INVALID_TABLE, ("LoadMemDDB: table validation failed (rc=%x)", rc)); } else { rc = LoadDDB(pctxt, pDDB, pctxt->pnsScope, ppowner); } EXIT(3, ("LoadMemDDB=%x (powner=%x)\n", rc, *ppowner)); return rc; } //LoadMemDDB /***LP LoadFieldUnitDDB - Load DDB from a FieldUnit object * * ENTRY * pctxt -> CTXT * pdataObj -> FieldUnit object * ppowner -> to hold owner handle * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL LoadFieldUnitDDB(PCTXT pctxt, POBJDATA pdataObj, POBJOWNER *ppowner) { TRACENAME("LOADFIELDUNITDDB") NTSTATUS rc = STATUS_SUCCESS; POBJDATA pdataTmp; DESCRIPTION_HEADER *pdh; ENTER(3, ("LoadFieldUnitDDB(pctxt=%x,pdataObj=%x,ppowner=%x)\n", pctxt, pdataObj, ppowner)); if ((pdataTmp = NEWODOBJ(pctxt->pheapCurrent, sizeof(OBJDATA))) == NULL) { rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("LoadFieldUnitDDB: failed to allocate temp. object data")); } else if ((pdh = NEWBDOBJ(gpheapGlobal, sizeof(DESCRIPTION_HEADER))) == NULL) { FREEODOBJ(pdataTmp); rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("LoadFieldUnitDDB: failed to allocate description header")); } else { PUCHAR pbTable; MEMZERO(pdataTmp, sizeof(OBJDATA)); pdataTmp->dwDataType = OBJTYPE_BUFFDATA; pdataTmp->dwDataLen = sizeof(DESCRIPTION_HEADER); pdataTmp->pbDataBuff = (PUCHAR)pdh; if ((rc = ReadObject(pctxt, pdataObj, pdataTmp)) == STATUS_SUCCESS) { if ((pbTable = NEWBDOBJ(gpheapGlobal, pdh->Length)) == NULL) { rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM, ("LoadFieldUnitDDB: failed to allocate buffer")); } else { MEMCPY(pbTable, pdh, sizeof(DESCRIPTION_HEADER)); pdataTmp->dwDataLen = pdh->Length - sizeof(DESCRIPTION_HEADER); pdataTmp->pbDataBuff = pbTable + sizeof(DESCRIPTION_HEADER); if ((rc = ReadObject(pctxt, pdataObj, pdataTmp)) == STATUS_SUCCESS) { if ((ghValidateTable.pfnHandler != NULL) && ((rc = ((PFNVT)ghValidateTable.pfnHandler)( (PDSDT)pbTable, ghValidateTable.uipParam)) != STATUS_SUCCESS)) { rc = AMLI_LOGERR(AMLIERR_INVALID_TABLE, ("LoadFieldUnitDDB: table validation failed (rc=%x)", rc)); } else { rc = LoadDDB(pctxt, (PDSDT)pbTable, pctxt->pnsScope, ppowner); } } else if (rc == AMLISTA_PENDING) { rc = AMLI_LOGERR(AMLIERR_FATAL, ("LoadFieldUnitDDB: definition block loading cannot block")); } FREEBDOBJ(pbTable); } } else if (rc == AMLISTA_PENDING) { rc = AMLI_LOGERR(AMLIERR_FATAL, ("LoadFieldUnitDDB: definition block loading cannot block")); } FREEBDOBJ(pdh); FREEODOBJ(pdataTmp); } EXIT(3, ("LoadFieldUnitDDB=%x (powner=%x)\n", rc, *ppowner)); return rc; } //LoadFieldUnitDDB /***LP UnloadDDB - Unload Differentiated Definition Block * * ENTRY * powner -> OBJOWNER * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ VOID LOCAL UnloadDDB(POBJOWNER powner) { TRACENAME("UNLOADDDB") ENTER(3, ("UnloadDDB(powner=%x)\n", powner)); // // Walk name space and remove all objects belongs to this DDB. // FreeObjOwner(powner, TRUE); #ifdef DEBUG { KIRQL oldIrql; KeAcquireSpinLock( &gdwGHeapSpinLock, &oldIrql ); gdwGHeapSnapshot = gdwGlobalHeapSize; KeReleaseSpinLock( &gdwGHeapSpinLock, oldIrql ); } #endif EXIT(3, ("UnloadDDB!\n")); } //UnloadDDB /***LP EvalPackageElement - Evaluate a package element * * ENTRY * ppkg -> package object * iPkgIndex - package index (0-based) * pdataResult -> result object * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ NTSTATUS LOCAL EvalPackageElement(PPACKAGEOBJ ppkg, int iPkgIndex, POBJDATA pdataResult) { TRACENAME("EVALPACKAGEELEMENT") NTSTATUS rc = STATUS_SUCCESS; ENTER(3, ("EvalPackageElement(ppkg=%x,Index=%d,pdataResult=%x)\n", ppkg, iPkgIndex, pdataResult)); ASSERT(pdataResult != NULL); if (iPkgIndex >= (int)ppkg->dwcElements) { rc = AMLIERR_INDEX_TOO_BIG; } else { rc = DupObjData(gpheapGlobal, pdataResult, &ppkg->adata[iPkgIndex]); } EXIT(3, ("EvalPackageElement=%x (Type=%s,Value=%x,Len=%d,Buff=%x)\n", rc, GetObjectTypeName(pdataResult->dwDataType), pdataResult->dwDataValue, pdataResult->dwDataLen, pdataResult->pbDataBuff)); return rc; } //EvalPackageElement #ifdef DEBUGGER /***LP DumpNameSpaceObject - Dump name space object * * ENTRY * pszPath -> name space path string * fRecursive - TRUE if also dump the subtree recursively * * EXIT-SUCCESS * returns STATUS_SUCCESS * EXIT-FAILURE * returns AMLIERR_ code */ LONG LOCAL DumpNameSpaceObject(PSZ pszPath, BOOLEAN fRecursive) { TRACENAME("DUMPNAMESPACEOBJECT") NTSTATUS rc = STATUS_SUCCESS; PNSOBJ pns; char szName[sizeof(NAMESEG) + 1]; ENTER(3, ("DumpNameSpaceObject(Path=%s,fRecursive=%x)\n", pszPath, fRecursive)); if ((rc = GetNameSpaceObject(pszPath, NULL, &pns, NSF_LOCAL_SCOPE)) == STATUS_SUCCESS) { PRINTF("\nACPI Name Space: %s (%p)\n", pszPath, pns); if (!fRecursive) { STRCPYN(szName, (PSZ)&pns->dwNameSeg, sizeof(NAMESEG)); DumpObject(&pns->ObjData, szName, 0); } else DumpNameSpaceTree(pns, 0); } else if (rc == AMLIERR_OBJ_NOT_FOUND) { PRINTF(MODNAME "_ERROR: object %s not found\n", pszPath); } EXIT(3, ("DumpNameSpaceObject=%x\n", rc)); return rc; } //DumpNameSpaceObject /***LP DumpNameSpaceTree - Dump all the name space objects in the subtree * * ENTRY * pnsObj -> name space subtree root * dwLevel - indent level * * EXIT * None */ VOID LOCAL DumpNameSpaceTree(PNSOBJ pnsObj, ULONG dwLevel) { TRACENAME("DUMPNAMESPACETREE") PNSOBJ pns, pnsNext; char szName[sizeof(NAMESEG) + 1]; ENTER(3, ("DumpNameSpaceTree(pns=%x,level=%d)\n", pnsObj, dwLevel)); // // First, dump myself // STRCPYN(szName, (PSZ)&pnsObj->dwNameSeg, sizeof(NAMESEG)); DumpObject(&pnsObj->ObjData, szName, dwLevel); // // Then, recursively dump each of my children // for (pns = pnsObj->pnsFirstChild; pns != NULL; pns = pnsNext) { // // If this is the last child, we have no more. // if ((pnsNext = (PNSOBJ)pns->list.plistNext) == pnsObj->pnsFirstChild) pnsNext = NULL; // // Dump a child // DumpNameSpaceTree(pns, dwLevel + 1); } EXIT(3, ("DumpNameSpaceTree!\n")); } //DumpNameSpaceTree #endif //ifdef DEBUGGER
  25. Yesssssssaaaaaaaaa Ты действительно самый лучший! @Mov AX, 0xDEAD What a crazy hard work. Here it is, XP SP2 bit64 on Gigabyte z690 UD DDR4 with free acpi.sys without any Debugger Dietmar
×
×
  • Create New...