• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Wierdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wierdness


  • Subject: Wierdness
  • From: "John C. Welch" <email@hidden>
  • Date: Mon, 23 Nov 2015 22:33:26 -0500
  • Thread-topic: Wierdness

So I’m now getting proper returns from KextManagerCopyLoadedKextInfo (THANK YOU SHANE!)

And I’m trying to do some conversions with the returned data. The weirdness is in that I’m sometimes successful, sometimes not. For example this is the current main body of the code:

on applicationWillFinishLaunching_(aNotification)

--this executest the method n kextlister2.m, which is returned as an NSDictionary, but coerced into
--a record for easier use
set theResult to (my loadedKextInfoWithIdentifiers:listOfIdentifiers infoKeys:listOfInfoKeys) as record

set theKextList to theResult as list --this is necessary, as otherwise, it's still a record of records, and
-- for our needs, a list of records is better.

repeat with x in theKextList --replace meaningless numbers with useful text.
set theItem to x
try --we wrap it in a try because not every entry has an OSBundleCPUType. This avoids crashing out when
--that happens
if (OSBundleCPUType of theItem as text) is "16777223" then
set OSBundleCPUType of x to "x86_64"
else if OSBundleCPUType of theItem is 16777234 then
set OSBundleCPUType of x to "PPC-64"
else if OSBundleCPUType of theItem is 18 then
set OSBundleCPUType of x to "PPC-32"
else if OSBundleCPUType of theItem is 7 then
set OSBundleCPUType of x to "i386-32"
end

if (OSKernelResource of theItem as text) is "0" then
log "false"
set OSKernelResource of theItem to "false"
else if OSKernelResource of theItem is 1 then
log "true"
set OSKernelResource of theItem to "true"
end if
on error --in this case, we don't care about the error, so we throw it away.
end try
--log theKextList
end
end applicationWillFinishLaunching_


I get back (one out of many, many items):


(

 {

        CFBundleIdentifier = "com.apple.driver.AppleACPIPlatform";

        CFBundleVersion = "4.0";

        OSBundleCPUType = "x86_64";

        OSBundleLoadSize = 393216;

        OSBundlePath = "/System/Library/Extensions/AppleACPIPlatform.kext";

        OSKernelResource = 0;

    }

)


Which is partially correct. For example, sometimes, the code to change the OSBundleCPUType works as above, but other times, it does not:


      {

        CFBundleIdentifier = "com.apple.AppleFSCompression.AppleFSCompressionTypeZlib";

        CFBundleVersion = "1.0.0";

        OSBundleCPUType = 16777223;

        OSBundleLoadSize = 24576;

        OSBundlePath = "/System/Library/Extensions/AppleFSCompressionTypeZlib.kext";

        OSKernelResource = 0;

    },


And I’ve yet to hit the secret sauce for the OSKernelResource to fire. If it was completely NOT working then that would make some sense. But it’s only sort of working. 



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Wierdness
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: AppleScript-Users Digest, Vol 12, Issue 547
  • Next by Date: Re: Wierdness
  • Previous by thread: Re: AppleScript-Users Digest, Vol 12, Issue 547
  • Next by thread: Re: Wierdness
  • Index(es):
    • Date
    • Thread